Package io.urf.surf
Class SURF.Name
- java.lang.Object
-
- io.urf.surf.SURF.Name
-
- Enclosing class:
- SURF
public static final class SURF.Name extends java.lang.ObjectUtilities for working with SURF names.- Author:
- Garret Wilson
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.PatternPATTERNA SURF name is a single name token.static java.util.regex.PatternTOKEN_PATTERNRegular expression pattern to match a SURF name token .
-
Constructor Summary
Constructors Constructor Description Name()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcheckArgumentValid(java.lang.String string)Confirms that the given string conforms to the rules for a SURF name.static java.lang.StringcheckArgumentValidToken(java.lang.String string)Confirms that the given string conforms to the rules for a SURF name token.static booleanisTokenBeginCharacter(int c)Determines if the given character is a SURF token name begin character.static booleanisTokenCharacter(int c)Determines if the given character is a SURF name token character.static booleanisValid(java.lang.String string)Determines whether the given string conforms to the rules for a SURF name.static booleanisValidToken(java.lang.String string)Determines whether the given string conforms to the rules for a SURF name token.
-
-
-
Method Detail
-
isValidToken
public static boolean isValidToken(java.lang.String string)
Determines whether the given string conforms to the rules for a SURF name token.- Parameters:
string- The string to test.- Returns:
trueif the string is a valid URF name token.- Throws:
java.lang.NullPointerException- if the given string isnull.- See Also:
TOKEN_PATTERN
-
checkArgumentValidToken
public static java.lang.String checkArgumentValidToken(java.lang.String string)
Confirms that the given string conforms to the rules for a SURF name token.- Parameters:
string- The string to check.- Returns:
- The given string.
- Throws:
java.lang.NullPointerException- if the given string isnull.java.lang.IllegalArgumentException- if the given string does not conform to the rules for a SURF name token.- See Also:
TOKEN_PATTERN
-
isTokenBeginCharacter
public static final boolean isTokenBeginCharacter(int c)
Determines if the given character is a SURF token name begin character. A name token begin character is a Unicode letter.- Parameters:
c- The character to check.- Returns:
trueif the character is a SURF name begin character.
-
isTokenCharacter
public static final boolean isTokenCharacter(int c)
Determines if the given character is a SURF name token character. A name token character is a Unicode letter, mark, number, or connector punctuation.- Parameters:
c- The character to check.- Returns:
trueif the character is a SURF name character.
-
isValid
public static boolean isValid(java.lang.String string)
Determines whether the given string conforms to the rules for a SURF name.- Parameters:
string- The string to test.- Returns:
trueif the string is a valid SURF name.- Throws:
java.lang.NullPointerException- if the given string isnull.- See Also:
PATTERN
-
checkArgumentValid
public static java.lang.String checkArgumentValid(java.lang.String string)
Confirms that the given string conforms to the rules for a SURF name.- Parameters:
string- The string to check.- Returns:
- The given string.
- Throws:
java.lang.NullPointerException- if the given string isnull.java.lang.IllegalArgumentException- if the given string does not conform to the rules for a SURF name.- See Also:
PATTERN
-
-