Class MultipleStringValueValidator

  • All Implemented Interfaces:
    ValueValidator

    public class MultipleStringValueValidator
    extends java.lang.Object
    implements ValueValidator
    Checks that the value is one of the acceptable single String values or an acceptable combination of String values
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String[] comboOptions  
      private java.lang.String[] singleOptions  
    • Constructor Summary

      Constructors 
      Constructor Description
      MultipleStringValueValidator​(java.lang.String[] singleOptions, java.lang.String[] comboOptions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean comboOptionsContains​(java.lang.String possibleVal)  
      java.lang.String getPossibleValues()
      Returns a string describing possible values in human-readable form that this ValueValidator accepts
      void validate​(java.lang.Object value)
      This method checks if the given object is a valid value for this specific ValueValidator.
      • Methods inherited from class java.lang.Object

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

      • singleOptions

        private final java.lang.String[] singleOptions
      • comboOptions

        private final java.lang.String[] comboOptions
    • Constructor Detail

      • MultipleStringValueValidator

        public MultipleStringValueValidator​(java.lang.String[] singleOptions,
                                            java.lang.String[] comboOptions)
    • Method Detail

      • validate

        public void validate​(java.lang.Object value)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: ValueValidator
        This method checks if the given object is a valid value for this specific ValueValidator. Any arbitrary operation can be performed to ensure that the value is valid.
        Specified by:
        validate in interface ValueValidator
        Parameters:
        value - The object to validate
        Throws:
        java.lang.IllegalArgumentException - if the value is invalid
      • comboOptionsContains

        private boolean comboOptionsContains​(java.lang.String possibleVal)