Class PropertyType


  • @ThreadSafe
    public class PropertyType
    extends java.lang.Object
    A simple PropertyType used to represent a string value that could be used as a regular expression or could be case insensitive. The equals method has been over-ridden so that the object will correctly compare to strings.
    Author:
    Jeremy Long
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyType()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Default implementation of equals.
      java.lang.String getValue()
      Gets the value of the value property.
      int hashCode()
      Default implementation of hashCode.
      boolean isCaseSensitive()
      Gets the value of the caseSensitive property.
      boolean isRegex()
      Returns whether or not the value is a regex.
      boolean matches​(java.lang.String text)
      Uses the object's properties to determine if the supplied string matches the value of this property.
      void setCaseSensitive​(boolean value)
      Sets the value of the caseSensitive property.
      void setRegex​(boolean value)
      Sets whether the value property is a regex.
      void setValue​(java.lang.String value)
      Sets the value of the value property.
      java.lang.String toString()
      Default implementation of toString().
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PropertyType

        public PropertyType()
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Gets the value of the value property.
        Returns:
        the value of the value property
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value of the value property.
        Parameters:
        value - the value of the value property
      • isRegex

        public boolean isRegex()
        Returns whether or not the value is a regex.
        Returns:
        true if the value is a regex, otherwise false
      • setRegex

        public void setRegex​(boolean value)
        Sets whether the value property is a regex.
        Parameters:
        value - true if the value is a regex, otherwise false
      • isCaseSensitive

        public boolean isCaseSensitive()
        Gets the value of the caseSensitive property.
        Returns:
        true if the value is case sensitive
      • setCaseSensitive

        public void setCaseSensitive​(boolean value)
        Sets the value of the caseSensitive property.
        Parameters:
        value - whether the value is case sensitive
      • matches

        public boolean matches​(java.lang.String text)
        Uses the object's properties to determine if the supplied string matches the value of this property.
        Parameters:
        text - the String to validate
        Returns:
        whether the text supplied is matched by the value of the property
      • hashCode

        public int hashCode()
        Default implementation of hashCode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code
      • equals

        public boolean equals​(java.lang.Object obj)
        Default implementation of equals.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare
        Returns:
        whether the objects are equivalent
      • toString

        public java.lang.String toString()
        Default implementation of toString().
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of the object