public class MonthPropertyType extends EnumPropertyType<Month>
dk.heick.properties.types.custom.enums.Month
. Constructor Example | Comments | ||
---|---|---|---|
Property<Month> A_PROPERTY = new Property<Month>("name", new MonthPropertyType()); |
No default value. | ||
Property<Month> A_PROPERTY = new Property<Month>("name", new MonthPropertyType(Month.OCTOBER)); |
With default value "Month.OCTOBER". | ||
Type of value(s) | Examples | Result | Comments |
Valid | OCTOBER | Month.OCTOBER | Validate successfully. |
Valid | NovEmber | Month.NOVEMBER | Validate successfully. |
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 . |
Month
,
Serialized FormTYPE
Constructor and Description |
---|
MonthPropertyType()
Default constructor, with
null as default value. |
MonthPropertyType(Month defaultValue)
Constructor with default value.
|
getEnumClazz, getEnumConstants, getRestrictions, isAllLowercased, isAllUppercased, setEnumClazz, validateConstraints, validateValue
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateNullType
public MonthPropertyType()
null
as default value.public MonthPropertyType(Month defaultValue)
defaultValue
- default value returned if property value is undefined.