Interface AttributeDefinition
-
- All Superinterfaces:
Attribute
- All Known Subinterfaces:
PropertyDefinition
- All Known Implementing Classes:
PropertyDefinitionImpl
public interface AttributeDefinition extends Attribute
Extends theAttributeinterface 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:
Attribute
-
-
Field Summary
Fields Modifier and Type Field Description static StringMANDATORY_PROPERTYThe property name for the 'mandatory' flag.static StringNOT_NULL_PROPERTYThe 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisMandatory()Checks if the attribute is mandatory.booleanisNotnull()Checks 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 Detail
-
MANDATORY_PROPERTY
static final String MANDATORY_PROPERTY
The property name for the 'mandatory' flag.- See Also:
- Constant Field Values
-
NOT_NULL_PROPERTY
static final String NOT_NULL_PROPERTY
The property name for the 'notnull' flag.- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
-