Class ListEachNumberConstraint<T>

  • All Implemented Interfaces:
    ParameterConstraint<T>

    public class ListEachNumberConstraint<T>
    extends java.lang.Object
    implements ParameterConstraint<T>
    Applies numeric constraints to all elements of a list.
    Since:
    0.5.5
    Author:
    Erich Schubert
    • Constructor Detail

      • ListEachNumberConstraint

        public ListEachNumberConstraint()
        Constructor.
      • ListEachNumberConstraint

        public ListEachNumberConstraint​(AbstractNumberConstraint constraint)
        Constructor.
        Parameters:
        constraint - Constraint to apply to all elements
    • Method Detail

      • addConstraint

        public void addConstraint​(AbstractNumberConstraint constraint)
        Add a constraint to this operator.
        Parameters:
        constraint - Constraint
      • test

        public void test​(T t)
                  throws ParameterException
        Description copied from interface: ParameterConstraint
        Checks if the value t of the parameter to be tested fulfills the parameter constraint. If not, a parameter exception is thrown.
        Specified by:
        test in interface ParameterConstraint<T>
        Parameters:
        t - Value to be checked whether or not it fulfills the underlying parameter constraint.
        Throws:
        ParameterException - if the parameter to be tested does not fulfill the parameter constraint
      • getDescription

        public java.lang.String getDescription​(java.lang.String parameterName)
        Description copied from interface: ParameterConstraint
        Returns a description of this constraint.
        Specified by:
        getDescription in interface ParameterConstraint<T>
        Parameters:
        parameterName - the name of the parameter this constraint is used for
        Returns:
        a description of this constraint