Interface AttributeDefinition
- All Superinterfaces:
Attribute
- All Known Subinterfaces:
PropertyDefinition
- All Known Implementing Classes:
PropertyDefinitionImpl
Extends the
Attribute interface to include properties that define
its requirement constraints.
This interface adds flags to specify whether an attribute is mandatory and whether its value can be null.
- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property name for the 'mandatory' flag.static final StringThe property name for the 'notnull' flag.Fields inherited from interface org.gcube.informationsystem.base.reference.Attribute
DEFAULT_VALUE_PROPERTY, DESCRIPTION_PROPERTY, MAX_PROPERTY, MIN_PROPERTY, NAME, NAME_PROPERTY, PROPERTY_TYPE_PROPERTY, REGEX_PROPERTY -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the attribute is mandatory.booleanChecks if the attribute's value cannot be null.voidsetMandatory(boolean mandatory) Sets whether the attribute is mandatory.voidsetNotnull(boolean notnull) Sets whether the attribute's value can be null.Methods inherited from interface org.gcube.informationsystem.base.reference.Attribute
getDefaultValue, getDescription, getMax, getMin, getName, getPropertyType, getPropertyTypeName, getRegexp, setDefaultValue, setDescription, setMax, setMin, setName, setPropertyType, setRegexp
-
Field Details
-
MANDATORY_PROPERTY
The property name for the 'mandatory' flag.- See Also:
-
NOT_NULL_PROPERTY
The property name for the 'notnull' flag.- See Also:
-
-
Method Details
-
isMandatory
boolean isMandatory()Checks if the attribute is mandatory.- Returns:
trueif the attribute is mandatory,falseotherwise.
-
setMandatory
void setMandatory(boolean mandatory) Sets whether the attribute is mandatory.- Parameters:
mandatory-trueto make the attribute mandatory,falseotherwise.
-
isNotnull
boolean isNotnull()Checks if the attribute's value cannot be null.- Returns:
trueif the attribute value must not be null,falseotherwise.
-
setNotnull
void setNotnull(boolean notnull) Sets whether the attribute's value can be null.- Parameters:
notnull-trueto enforce a non-null value,falseotherwise.
-