public class IPRangePropertyType extends PropertyType<IPRange>
Constructor Example | Comments | ||
---|---|---|---|
Property<IPRange;> P_MY_IP_RANGE = |
A IPRangePropertyType with no default value. | ||
Type of value(s) | Examples | Result | Comments |
Valid | 192.168.*.* | new IPRange("192.168.*.*") | Validate successfully. |
Valid | 10.*.*.* | new IPRange("10.*.*.*") | Validate successfully. |
Valid | 127.0.0.1 | new IPRange("127.0.0.1") | Validate successfully. |
Invalid | null |
Validate will throw an exception. The resulting value is null . |
|
Invalid | cow | null |
Validate will throw an exception. The resulting value is null . |
Invalid | «empty string» | null |
|
Invalid | «empty string after trim» | null |
|
Invalid | null |
defaultValue OR null |
Validate will throw an exception. Return default value if set, otherwise null . |
Modifier and Type | Field and Description |
---|---|
static String |
TYPE
The type name string constant of IPRangePropertyType
|
Constructor and Description |
---|
IPRangePropertyType()
Default constructor where default value is
null . |
IPRangePropertyType(IPRange defaultValue)
Constructor with default value.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getRestrictions()
Gets a detailed description of the PropertyType with any constraints that might influence the validation.
|
IPRange |
validateValue(String propertyName,
String value)
Converts the string representation of to a typed value.
|
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateConstraints, validateNullType
public static final String TYPE
public IPRangePropertyType()
null
.public IPRangePropertyType(IPRange defaultValue)
defaultValue
- default value returned if property value is undefined.public List<String> getRestrictions()
PropertyType
getRestrictions
in class PropertyType<IPRange>
public IPRange validateValue(String propertyName, String value) throws PropertyException
PropertyType
validateValue
in class PropertyType<IPRange>
propertyName
- the name of the property used for logging purposes. To uniquely identify the Property with validation issues.value
- the string representation of the propertyPropertyException
- if the conversion failed.