public class IP4AddressPropertyType extends PropertyType<String>
InetAddressPropertyType instead.
| Constructor Example | Comments | ||
|---|---|---|---|
Property<String> A_PROPERTY = new Property<String>("name", new IP4AddressPropertyType()); |
A InetAddressPropertyType with no default value. | ||
Property<String> A_PROPERTY = new Property<String>("name", new IP4AddressPropertyType("127.0.0.1")); |
A InetAddressPropertyType with a default value. | ||
| Type of value(s) | Examples | Result | Comments |
| Valid | 127.0.0.1 | 127.0.0.1" | Validate successfully. |
| Valid | 195.59.44.33 | "195.59.44.33" | 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. |
InetAddressPropertyType,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
The type name string constant of IpAddressPropertyType.
|
| Constructor and Description |
|---|
IP4AddressPropertyType()
Default constructor with
null as default value. |
IP4AddressPropertyType(String defaultValue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getRestrictions()
Gets a detailed description of the PropertyType with any constraints that might influence the validation.
|
String |
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, validateNullTypepublic static final String TYPE
public IP4AddressPropertyType()
null as default value.public IP4AddressPropertyType(String defaultValue)
defaultValue - default value returned if property value is undefined.public List<String> getRestrictions()
PropertyTypegetRestrictions in class PropertyType<String>public String validateValue(String propertyName, String value) throws PropertyException
PropertyTypevalidateValue in class PropertyType<String>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.