Class ParameterType<T>

    • Field Detail

      • defaultValue

        protected final T defaultValue
        Default value.
    • Constructor Detail

      • ParameterType

        public ParameterType​(String id,
                             String description,
                             Class<T> valueClass)
        Construct a new AbstractParameterType without default value and constraint.
        Parameters:
        id - String; short name of the new AbstractParameterType
        description - String; description or full name of the new AbstractParameterType
        valueClass - Class<T>; class of the value of the new AbstractParameterType
      • ParameterType

        public ParameterType​(String id,
                             String description,
                             Class<T> valueClass,
                             Constraint<? super T> constraint)
        Construct a new AbstractParameterType without default value and with constraint.
        Parameters:
        id - String; short name of the new AbstractParameterType
        description - String; description or full name of the new AbstractParameterType
        valueClass - Class<T>; class of the value of the new AbstractParameterType
        constraint - Constraint<? super T>; constraint that applies to the value of the new AbstractParameterType
      • ParameterType

        public ParameterType​(String id,
                             String description,
                             Class<T> valueClass,
                             T defaultValue)
        Construct a new AbstractParameterType with default value, without constraint.
        Parameters:
        id - String; short name of the new AbstractParameterType
        description - String; description or full name of the new AbstractParameterType
        valueClass - Class<T>; class of the value of the new AbstractParameterType
        defaultValue - T; default value of the new AbstractParameterType
      • ParameterType

        public ParameterType​(String id,
                             String description,
                             Class<T> valueClass,
                             T defaultValue,
                             Constraint<? super T> constraint)
        Construct a new AbstractParameterType with default value and constraint.
        Parameters:
        id - String; short name of the new AbstractParameterType
        description - String; description or full name of the new AbstractParameterType
        valueClass - Class<T>; class of the value of the new AbstractParameterType
        defaultValue - T; default value of the new AbstractParameterType
        constraint - Constraint<? super T>; constraint that applies to the value of the new AbstractParameterType
    • Method Detail

      • getId

        public final String getId()
        Retrieve the id of this AbstractParameterType.
        Specified by:
        getId in interface Identifiable
        Returns:
        String; the id of this AbstractParameterType
      • getDescription

        public final String getDescription()
        Retrieve the description of this AbstractParameterType.
        Returns:
        String; the description of this AbstractParameterType
      • getValueClass

        public final Class<T> getValueClass()
        Retrieve the class of the value of this AbstractParameterType.
        Returns:
        valueClass Class<T>; the class of the value of this AbstractParameterType
      • hasDefaultValue

        public final boolean hasDefaultValue()
        Returns whether this parameter type has a default value.
        Returns:
        boolean; true if this AbstractParameterType type has a default value; false if it does not have a default value
      • getDefaultValue

        public final T getDefaultValue()
                                throws ParameterException
        Retrieve the the default value of this AbstractParameterType.
        Returns:
        T; the default value of this AbstractParameterType
        Throws:
        ParameterException - if this AbstractParameterType does not have a default value
      • checkConstraint

        public final void checkConstraint​(T value)
                                   throws ParameterException
        Check that a value complies with the constraint of this AbstractParameterType.
        Parameters:
        value - T; the value to check
        Throws:
        ParameterException - if the value does not comply with constraints
      • check

        public void check​(T value,
                          Parameters params)
                   throws ParameterException
        Default implementation of check method. This default implementation will never throw any Exception.
        Parameters:
        value - T; the value to check
        params - Parameters; Set of parameters to check
        Throws:
        ParameterException - If the value does not comply with constraints.
      • printValue

        public String printValue​(Parameters parameters)
                          throws ParameterException
        Print the given value from the map in Parameters in a presentable format. The default implementation simply returns the output of toString().
        Parameters:
        parameters - Parameters; Parameters to get the value from
        Returns:
        String; readable representation of the value
        Throws:
        ParameterException - If the parameter is not present
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • getConstraint

        public final Constraint<? super T> getConstraint()
        Retrieve the constraint.
        Returns:
        Constraint; the constraint of this AbstractParameterType