Class QueryValue

    • Constructor Summary

      Constructors 
      Constructor Description
      QueryValue​(java.lang.Object value)
      Construct a QueryValue
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Overrides Object.
      int getApproximateType()
      Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.
      java.lang.Class<?> getType()
      Get Java type represented by this item.
      java.lang.Object getValue()
      Returns the object that is the actual value.
      int hashCode()
      Overrides Object.
      java.lang.String toString()
      void youAreType​(java.lang.Class<?> cls)
      Allows a caller to suggest to this object that it holds a value of a certain type.
      • Methods inherited from class java.lang.Object

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

      • TRUE

        public static final QueryValue TRUE
        The true value
      • FALSE

        public static final QueryValue FALSE
        The false value
    • Constructor Detail

      • QueryValue

        public QueryValue​(java.lang.Object value)
        Construct a QueryValue
        Parameters:
        value - the value of this QueryValue
        Throws:
        java.lang.IllegalArgumentException - if value is not a Number, String, Boolean or Date
    • Method Detail

      • getType

        public java.lang.Class<?> getType()
        Get Java type represented by this item.
        Specified by:
        getType in interface QueryOrderable
        Specified by:
        getType in interface QuerySelectable
        Returns:
        class describing the type
      • getValue

        public java.lang.Object getValue()
        Returns the object that is the actual value.
        Returns:
        the value
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides Object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - object to compare to
        Returns:
        true if obj is a QueryValue with the same encapsulated object
      • hashCode

        public int hashCode()
        Overrides Object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        an integer based on the contents of this object
      • youAreType

        public void youAreType​(java.lang.Class<?> cls)
        Allows a caller to suggest to this object that it holds a value of a certain type. This method should only be called on objects which report their type to be UnknownTypeValue. Otherwise, this method will throw and exception.
        Specified by:
        youAreType in interface QueryEvaluable
        Parameters:
        cls - the Class of the type to be imposed on this object
      • getApproximateType

        public int getApproximateType()
        Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.
        Specified by:
        getApproximateType in interface QueryEvaluable
        Returns:
        an int, as described in UnknownTypeValue
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object