Class ComparatorValidator

  • All Implemented Interfaces:
    java.io.Serializable, IValidator

    public class ComparatorValidator
    extends java.lang.Object
    implements IValidator
    Assert that a comparation is true.

    Author:
    Javier Paniza
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName1()
      Name (used for retrieve label from i18n files) for first value.
      java.lang.String getName2()
      Name (used for retrieve label from i18n files) for second value.
      java.lang.String getOperator()
      Operator used for comparing.
      java.lang.Comparable getValue1()
      First value to compare.
      java.lang.Comparable getValue2()
      Second value to compare.
      void setName1​(java.lang.String name1)
      Name (used for retrieve label from i18n files) for first value.
      void setName2​(java.lang.String name2)
      Name (used for retrieve label from i18n files) for second value.
      void setOperator​(java.lang.String operator)
      Operator used for comparing.
      void setValue1​(java.lang.Comparable value1)
      First value to compare.
      void setValue2​(java.lang.Comparable value2)
      Second value to compare.
      void validate​(Messages errors)
      Does validation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ComparatorValidator

        public ComparatorValidator()
    • Method Detail

      • validate

        public void validate​(Messages errors)
                      throws java.lang.Exception
        Description copied from interface: IValidator
        Does validation.

        Specified by:
        validate in interface IValidator
        Parameters:
        errors - Validation errors list; a list of id to read in the resources file
        Throws:
        java.lang.Exception - Any unexpected problem
      • getOperator

        public java.lang.String getOperator()
        Operator used for comparing.

        Values allowed are EQ, NE, GT, LT, GE, LE, =, ==, !=, >, <, >=, <=.
        Default value is =.

      • setOperator

        public void setOperator​(java.lang.String operator)
        Operator used for comparing.

        Values allowed are EQ, NE, GT, LT, GE, LE, =, ==, !=, >, <, >=, <=.
        Default value is =.

      • getValue1

        public java.lang.Comparable getValue1()
        First value to compare.

      • setValue1

        public void setValue1​(java.lang.Comparable value1)
        First value to compare.

      • getValue2

        public java.lang.Comparable getValue2()
        Second value to compare.

      • setValue2

        public void setValue2​(java.lang.Comparable value2)
        Second value to compare.

      • getName1

        public java.lang.String getName1()
        Name (used for retrieve label from i18n files) for first value.
      • setName1

        public void setName1​(java.lang.String name1)
        Name (used for retrieve label from i18n files) for first value.
      • getName2

        public java.lang.String getName2()
        Name (used for retrieve label from i18n files) for second value.
      • setName2

        public void setName2​(java.lang.String name2)
        Name (used for retrieve label from i18n files) for second value.