public class NullablePropertyMetadata<T> extends AbstractPropertyMetadata<T>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SHOULD_NOT_BE_NULL
Error message for null
|
PROPERTY_ERROR_INVALID_NAME
Constructor and Description |
---|
NullablePropertyMetadata(java.lang.String name,
boolean notNull)
Initializes with the property name and whether null values are not allowed
|
Modifier and Type | Method and Description |
---|---|
boolean |
getNotNull() |
void |
setNotNull(boolean notNull) |
T |
validate(T value)
Validates the given value with the current constraints.
|
getName, setName
public static final java.lang.String SHOULD_NOT_BE_NULL
public NullablePropertyMetadata(java.lang.String name, boolean notNull)
java.lang.IllegalArgumentException
- Property metadata name cannot be null or empty!public boolean getNotNull()
public void setNotNull(boolean notNull)
public T validate(T value) throws ValidationException
validate
in interface IPropertyMetadata<T>
validate
in class AbstractPropertyMetadata<T>
ValidationException
- Thrown upon validation errors