Class TemplateVariableImpl
- java.lang.Object
-
- org.gcube.informationsystem.base.impl.ElementImpl
-
- org.gcube.informationsystem.base.impl.properties.PropertyElementImpl
-
- org.gcube.informationsystem.queries.templates.impl.properties.TemplateVariableImpl
-
- All Implemented Interfaces:
Serializable,Attribute,Element,PropertyElement,SchemaMixedElement,ModelElement,Property,TemplateVariable
public class TemplateVariableImpl extends PropertyElementImpl implements TemplateVariable
The default implementation of theTemplateVariableinterface.- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectdefaultValueThe default value of the variable.protected StringdescriptionThe description of the variable.protected StringnameThe name of the variable.-
Fields inherited from class org.gcube.informationsystem.base.impl.properties.PropertyElementImpl
additionalProperties, allowedAdditionalKeys, expectedtype, supertypes
-
Fields inherited from interface org.gcube.informationsystem.base.reference.Attribute
DEFAULT_VALUE_PROPERTY, DESCRIPTION_PROPERTY, MAX_PROPERTY, MIN_PROPERTY, NAME_PROPERTY, PROPERTY_TYPE_PROPERTY, REGEX_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, NAME, TYPE_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.model.reference.ModelElement
EXPECTED_TYPE_PROPERTY, SUPERTYPES_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.model.reference.properties.Property
NAME
-
Fields inherited from interface org.gcube.informationsystem.queries.templates.reference.properties.TemplateVariable
NAME, VERSION
-
-
Constructor Summary
Constructors Constructor Description TemplateVariableImpl()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetDefaultValue()Returns the default value of the attribute.StringgetDescription()Returns the description of the attribute.IntegergetMax()Returns the maximum allowed value for the attribute.IntegergetMin()Returns the minimum allowed value for the attribute.StringgetName()Returns the name of the attribute.StringgetPropertyType()Returns the property type of the attribute as a string.PropertyTypeNamegetPropertyTypeName()Gets the property type name.StringgetRegexp()Returns the regular expression used to validate the attribute's value.voidsetDefaultValue(Object defaultValue)Sets the default value of the attribute.voidsetDescription(String description)Sets the description of the attribute.voidsetMax(Integer max)Sets the maximum allowed value for the attribute.voidsetMin(Integer min)Sets the minimum allowed value for the attribute.voidsetName(String name)Sets the name of the attribute.voidsetPropertyType(String type)Sets the property type.voidsetRegexp(String regexp)Sets the regular expression for validating the attribute's value.StringtoString()Returns a JSON representation of the element.-
Methods inherited from class org.gcube.informationsystem.base.impl.properties.PropertyElementImpl
addAllowedAdditionalKey, getAdditionalProperties, getAdditionalProperty, getExpectedtype, getSupertypes, setAdditionalProperties, setAdditionalProperty
-
Methods inherited from class org.gcube.informationsystem.base.impl.ElementImpl
getTypeName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
-
-
-
Method Detail
-
getName
public String getName()
Returns the name of the attribute.- Specified by:
getNamein interfaceAttribute- Specified by:
getNamein interfaceTemplateVariable- Returns:
- The attribute's name.
-
setName
public void setName(String name)
Sets the name of the attribute.
-
getDescription
public String getDescription()
Returns the description of the attribute.- Specified by:
getDescriptionin interfaceAttribute- Specified by:
getDescriptionin interfaceTemplateVariable- Returns:
- The attribute's description.
-
setDescription
public void setDescription(String description)
Sets the description of the attribute.- Specified by:
setDescriptionin interfaceAttribute- Parameters:
description- The description to set.
-
getMax
public Integer getMax()
Returns the maximum allowed value for the attribute.- Specified by:
getMaxin interfaceAttribute- Specified by:
getMaxin interfaceTemplateVariable- Returns:
- The maximum value, or
nullif not set.
-
setMax
public void setMax(Integer max)
Sets the maximum allowed value for the attribute.
-
getMin
public Integer getMin()
Returns the minimum allowed value for the attribute.- Specified by:
getMinin interfaceAttribute- Specified by:
getMinin interfaceTemplateVariable- Returns:
- The minimum value, or
nullif not set.
-
setMin
public void setMin(Integer min)
Sets the minimum allowed value for the attribute.
-
getRegexp
public String getRegexp()
Returns the regular expression used to validate the attribute's value.- Specified by:
getRegexpin interfaceAttribute- Specified by:
getRegexpin interfaceTemplateVariable- Returns:
- The regular expression, or
nullif not set.
-
setRegexp
public void setRegexp(String regexp)
Sets the regular expression for validating the attribute's value.
-
getPropertyType
public String getPropertyType()
Returns the property type of the attribute as a string.- Specified by:
getPropertyTypein interfaceAttribute- Specified by:
getPropertyTypein interfaceTemplateVariable- Returns:
- The property type.
-
setPropertyType
public void setPropertyType(String type)
Sets the property type.- Specified by:
setPropertyTypein interfaceAttribute- Parameters:
type- the type
-
getPropertyTypeName
public PropertyTypeName getPropertyTypeName()
Gets the property type name.- Specified by:
getPropertyTypeNamein interfaceAttribute- Returns:
- the property type name
-
getDefaultValue
public Object getDefaultValue()
Returns the default value of the attribute.- Specified by:
getDefaultValuein interfaceAttribute- Specified by:
getDefaultValuein interfaceTemplateVariable- Returns:
- The default value.
-
setDefaultValue
public void setDefaultValue(Object defaultValue)
Sets the default value of the attribute.- Specified by:
setDefaultValuein interfaceAttribute- Parameters:
defaultValue- The default value to set.
-
toString
public String toString()
Returns a JSON representation of the element.- Overrides:
toStringin classElementImpl- Returns:
- The JSON string representation of the object.
-
-