Interface ParameterSchema

  • All Known Implementing Classes:
    DefaultParameterSchema

    public interface ParameterSchema
    Encapsulates the details about a particular individual parameter.
    Author:
    Nick Collier
    • Method Detail

      • getType

        Class getType()
        Gets the type of the parameter.
        Returns:
        the type of the parameter.
      • getDefaultValue

        Object getDefaultValue()
        Gets the default value of the parameter.
        Returns:
        the default value of the parameter.
      • setDefaultValue

        void setDefaultValue​(Object obj)
        Sets the default value of this parameter.
        Parameters:
        obj - the new default value
      • getConstrainingRange

        SteppedRange getConstrainingRange()
        Gets the numeric range of values that constrain this parameter. This will return null if the parameter is unconstrained by a numeric range.
        Returns:
        the numeric range of values that constrain this parameter or null if the parameter is unconstrained by a range.
      • getConstrainingList

        List getConstrainingList()
        Gets the list of values that constrain this parameter. This will return null if the parameter is unconstrained by a list.
        Returns:
        the list of values that constrain this parameter or null if the parameter is unconstrained by a list of possible values.
      • getConstraintString

        String getConstraintString()
        Gets the string representation of the values or range that constrain this parameter This will return an empty string if the parameter is not constrained (by a list or range)
        Returns:
        the string representation of the parameter constraints, if unconstrained an empty string
      • validate

        boolean validate​(Object obj)
        Validates the specified object against the type and optional constraint info for the parameter name.
        Parameters:
        obj - the object to validate
        Returns:
        true if the object is of a type valid for the parameter, otherwise false.
      • getName

        String getName()
        Gets the name of the parameter that this is the schema for.
        Returns:
        the name of the parameter that this is the schema for.
      • toString

        String toString​(Object obj)
        Converts the object into a String representation.
        Parameters:
        obj - the object to convert
        Returns:
        the String representation.
      • fromString

        Object fromString​(String str)
        Creates an Object from the String representation.
        Parameters:
        str - the String representation
        Returns:
        the created Object
      • getConverter

        StringConverter getConverter()
        Gets the convertor, if any, for this ParameterSchema.
        Returns:
        the convertor, or null if there is no covertor for this ParameterSchema.