Class UnknownTypeValue


  • public class UnknownTypeValue
    extends java.lang.Object
    Represents a value with an unknown type. The value is stored as a String representation - the representation used in IQL. It is presumed that these unknown type values are converted into typed values before the Query is finished constructing. Therefore, these objects are merely a temporary placeholder for values before their type is inferred.
    Author:
    Matthew Wakeling
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE_BOOLEAN
      A value that indicates that the value represents a Boolean.
      static int TYPE_NUMBER
      A value that indicates that the value represents a number.
      static int TYPE_STRING
      A value that indicates that the value represents a String or Date.
    • Constructor Summary

      Constructors 
      Constructor Description
      UnknownTypeValue​(java.lang.String value)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static int classToType​(java.lang.Class<?> cls)
      Converts a Class into an approximate type.
      int getApproximateType()
      Returns the approximate type of the argument.
      java.lang.Object getConvertedValue​(java.lang.Class<?> cls)
      Returns the value, converted (if possible) into the object type given by the input class.
      java.lang.String getValue()
      Returns the value.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

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

      • TYPE_NUMBER

        public static final int TYPE_NUMBER
        A value that indicates that the value represents a number.
        See Also:
        Constant Field Values
      • TYPE_BOOLEAN

        public static final int TYPE_BOOLEAN
        A value that indicates that the value represents a Boolean.
        See Also:
        Constant Field Values
      • TYPE_STRING

        public static final int TYPE_STRING
        A value that indicates that the value represents a String or Date.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UnknownTypeValue

        public UnknownTypeValue​(java.lang.String value)
        Constructor.
        Parameters:
        value - the value
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Returns the value.
        Returns:
        the value
      • getConvertedValue

        public java.lang.Object getConvertedValue​(java.lang.Class<?> cls)
        Returns the value, converted (if possible) into the object type given by the input class.
        Parameters:
        cls - a Class into which to attempt to convert the value
        Returns:
        the converted value
      • toString

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

        public int getApproximateType()
        Returns the approximate type of the argument.
        Returns:
        an int
      • classToType

        public static int classToType​(java.lang.Class<?> cls)
        Converts a Class into an approximate type.
        Parameters:
        cls - the Class to convert
        Returns:
        an int