Class BooleanConstraint

  • All Implemented Interfaces:
    ConstraintInterface<java.lang.Object,​java.lang.Boolean>

    public class BooleanConstraint
    extends java.lang.Object
    implements ConstraintInterface<java.lang.Object,​java.lang.Boolean>
    Boolean Constraint Class
    See Also:
    Boolean types
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.ArrayList<java.lang.String> getErrors()
      Get Errors List
      java.lang.String getFieldName()
      Get Field Name
      java.lang.Boolean getRequired()
      Get Required
      java.lang.Boolean getValue()
      Get Value
      java.lang.Boolean hasErrors()
      If validation has errors
      java.lang.Boolean isValidType()
      Is Valid
      void setFieldName​(java.lang.String fieldName)
      Set Field Name
      void setRequired​(java.lang.Boolean required)
      Set Required
      void setValue​(java.lang.Object value)
      Set Value
      java.lang.Boolean validate()
      Validate field value
      • Methods inherited from class java.lang.Object

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

      • BooleanConstraint

        public BooleanConstraint()
    • Method Detail

      • setFieldName

        public void setFieldName​(java.lang.String fieldName)
        Set Field Name
        Specified by:
        setFieldName in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Parameters:
        fieldName - the field name
      • setValue

        public void setValue​(java.lang.Object value)
        Set Value
        Specified by:
        setValue in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Parameters:
        value - the value
      • getValue

        public java.lang.Boolean getValue()
        Get Value
        Specified by:
        getValue in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        the value
      • getFieldName

        public java.lang.String getFieldName()
        Get Field Name
        Specified by:
        getFieldName in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        the field name
      • isValidType

        public java.lang.Boolean isValidType()
        Is Valid
        Specified by:
        isValidType in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        If value is valid
      • validate

        public java.lang.Boolean validate()
        Validate field value
        Specified by:
        validate in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        whether field value is valid or not
      • setRequired

        public void setRequired​(java.lang.Boolean required)
        Set Required
        Specified by:
        setRequired in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Parameters:
        required - whether required or not
      • getRequired

        public java.lang.Boolean getRequired()
        Get Required
        Specified by:
        getRequired in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        whether required or not
      • getErrors

        public java.util.ArrayList<java.lang.String> getErrors()
        Get Errors List
        Specified by:
        getErrors in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        the errors list
      • hasErrors

        public java.lang.Boolean hasErrors()
        If validation has errors
        Specified by:
        hasErrors in interface ConstraintInterface<java.lang.Object,​java.lang.Boolean>
        Returns:
        whether there is errors