Package com.mycompany.myproject.types
Class LastName
- java.lang.Object
-
- org.xins.common.types.Type
-
- org.xins.common.types.PatternType
-
- com.mycompany.myproject.types.LastName
-
public final class LastName extends PatternType
Pattern type LastName.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
fromStringForOptional(java.lang.String string)
Converts the specified character string -ornull
- to a value for this type.static java.lang.String
fromStringForRequired(java.lang.String string)
Converts the specified character string to a value for this type.java.lang.String
getDescription()
-
Methods inherited from class org.xins.common.types.PatternType
getPattern, toString
-
Methods inherited from class org.xins.common.types.Type
checkValue, fromString, getName, getValueClass, isValidValue, toString
-
-
-
-
Field Detail
-
SINGLETON
public static final LastName SINGLETON
The only instance of this class. This field is nevernull
.
-
-
Method Detail
-
fromStringForRequired
public static java.lang.String fromStringForRequired(java.lang.String string) throws java.lang.IllegalArgumentException, TypeValueException
Converts the specified character string to a value for this type. The character string cannot benull
. If it is, then an exception is thrown.- Parameters:
string
- the character string to convert to a value for this type, cannot benull
.- Returns:
- the converted value for this type, never
null
. - Throws:
java.lang.IllegalArgumentException
- ifstring == null
.TypeValueException
- if the specified character string is not considered valid for this type.
-
fromStringForOptional
public static java.lang.String fromStringForOptional(java.lang.String string) throws TypeValueException
Converts the specified character string -ornull
- to a value for this type. The character string can benull
in which casenull
is also returned.- Parameters:
string
- the character string to convert to a value for this type, can benull
.- Returns:
- the converted value for this type, or
null
. - Throws:
TypeValueException
- if the specified character string is not considered valid for this type.
-
getDescription
public java.lang.String getDescription()
- Overrides:
getDescription
in classPatternType
-
-