Class TemplateVariableImpl

    • Field Detail

      • name

        protected String name
        The name of the variable.
      • description

        protected String description
        The description of the variable.
      • defaultValue

        protected Object defaultValue
        The default value of the variable.
      • required

        protected boolean required
        Whether the variable is required at execution time.
    • Constructor Detail

      • TemplateVariableImpl

        public TemplateVariableImpl()
        Default constructor.
    • Method Detail

      • setName

        public void setName​(String name)
        Sets the name of the attribute.
        Specified by:
        setName in interface Attribute
        Parameters:
        name - The name to set.
      • setDescription

        public void setDescription​(String description)
        Sets the description of the attribute.
        Specified by:
        setDescription in interface Attribute
        Parameters:
        description - The description to set.
      • getMax

        public Integer getMax()
        Returns the upper bound of the attribute.

        The bound is an integer, unless the attribute admits a decimal one: a PropertyDefinition whose base type is Double or Float.

        Specified by:
        getMax in interface Attribute
        Specified by:
        getMax in interface TemplateVariable
        Returns:
        The upper bound, or null if not set.
      • setMax

        public void setMax​(Number max)
        Sets the upper bound of the attribute.
        Specified by:
        setMax in interface Attribute
        Parameters:
        max - The upper bound to set, null for none.
        Throws:
        IllegalArgumentException - if max is not an integer
      • getMin

        public Integer getMin()
        Returns the lower bound of the attribute.

        The bound is an integer, unless the attribute admits a decimal one: a PropertyDefinition whose base type is Double or Float.

        Specified by:
        getMin in interface Attribute
        Specified by:
        getMin in interface TemplateVariable
        Returns:
        The lower bound, or null if not set.
      • setMin

        public void setMin​(Number min)
        Sets the lower bound of the attribute.
        Specified by:
        setMin in interface Attribute
        Parameters:
        min - The lower bound to set, null for none.
        Throws:
        IllegalArgumentException - if min is not an integer
      • getRegexp

        public String getRegexp()
        Returns the regular expression used to validate the attribute's value.
        Specified by:
        getRegexp in interface Attribute
        Specified by:
        getRegexp in interface TemplateVariable
        Returns:
        The regular expression, or null if not set.
      • setRegexp

        public void setRegexp​(String regexp)
        Sets the regular expression for validating the attribute's value.
        Specified by:
        setRegexp in interface Attribute
        Parameters:
        regexp - The regular expression to set.
      • setPropertyType

        public void setPropertyType​(String type)
        Sets the property type.
        Specified by:
        setPropertyType in interface Attribute
        Parameters:
        type - the type
      • setDefaultValue

        public void setDefaultValue​(Object defaultValue)
        Sets the default value of the attribute.
        Specified by:
        setDefaultValue in interface Attribute
        Parameters:
        defaultValue - The default value to set.
      • isRequired

        public boolean isRequired()
        Indicates whether the execution payload must supply this variable. When false, an omitted variable takes its default value.
        Specified by:
        isRequired in interface TemplateVariable
        Returns:
        true if the variable is required at execution time.
      • setRequired

        public void setRequired​(boolean required)
        Sets whether the execution payload must supply this variable.
        Specified by:
        setRequired in interface TemplateVariable
        Parameters:
        required - true if the variable is required at execution time.
      • toString

        public String toString()
        Returns a JSON representation of the element.
        Overrides:
        toString in class ElementImpl
        Returns:
        The JSON string representation of the object.