Class Type<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    java.lang.Comparable<Type<?>>

    public final class Type<T>
    extends java.lang.Object
    implements java.lang.Comparable<Type<?>>
    Instances of this class map Java types to property types. Passing an instance of this class to PropertyState.getValue(Type) determines the return type of that method.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Type<java.lang.Iterable<Blob>> BINARIES
      Map Iterable<Blob> to array of PropertyType.BINARY
      static Type<Blob> BINARY
      Map Blob to PropertyType.BINARY
      static Type<java.lang.Boolean> BOOLEAN
      Map Boolean to PropertyType.BOOLEAN
      static Type<java.lang.Iterable<java.lang.Boolean>> BOOLEANS
      Map Iterable<Boolean> to array of PropertyType.BOOLEAN
      static Type<java.lang.String> DATE
      Map String to PropertyType.DATE
      static Type<java.lang.Iterable<java.lang.String>> DATES
      Map Iterable<String> to array of PropertyType.DATE
      static Type<java.math.BigDecimal> DECIMAL
      Map BigDecimal to PropertyType.DECIMAL
      static Type<java.lang.Iterable<java.math.BigDecimal>> DECIMALS
      Map Iterable<BigDecimal> to array of PropertyType.DECIMAL
      static Type<java.lang.Double> DOUBLE
      Map Double to PropertyType.DOUBLE
      static Type<java.lang.Iterable<java.lang.Double>> DOUBLES
      Map Iterable<Double> to array of PropertyType.DOUBLE
      static Type<java.lang.Long> LONG
      Map Long to PropertyType.LONG
      static Type<java.lang.Iterable<java.lang.Long>> LONGS
      Map Iterable<Long> to array of PropertyType.LONG
      static Type<java.lang.String> NAME
      Map String to PropertyType.STRING
      static Type<java.lang.Iterable<java.lang.String>> NAMES
      Map Iterable<String> to array of PropertyType.NAME
      static Type<java.lang.String> PATH
      Map String to PropertyType.PATH
      static Type<java.lang.Iterable<java.lang.String>> PATHS
      Map Iterable<String> to array of PropertyType.PATH
      static Type<java.lang.String> REFERENCE
      Map String to PropertyType.REFERENCE
      static Type<java.lang.Iterable<java.lang.String>> REFERENCES
      Map Iterable<String> to array of PropertyType.REFERENCE
      static Type<java.lang.String> STRING
      Map String to PropertyType.STRING
      static Type<java.lang.Iterable<java.lang.String>> STRINGS
      Map Iterable<String> to array of PropertyType.STRING
      static Type<java.lang.Void> UNDEFINED
      The special "undefined" type, never encountered in normal values
      static Type<java.lang.Iterable<java.lang.Void>> UNDEFINEDS
      Multi-valued "undefined" type, never encountered in normal values
      static Type<java.lang.String> URI
      Map String to PropertyType.URI
      static Type<java.lang.Iterable<java.lang.String>> URIS
      Map Iterable<String> to array of PropertyType.URI
      static Type<java.lang.String> WEAKREFERENCE
      Map String to PropertyType.WEAKREFERENCE
      static Type<java.lang.Iterable<java.lang.String>> WEAKREFERENCES
      Map Iterable<String> to array of PropertyType.WEAKREFERENCE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(@NotNull Type<?> that)  
      boolean equals​(java.lang.Object other)  
      static Type<?> fromString​(java.lang.String string)
      Returns the Type with the given string representation.
      static Type<?> fromTag​(int tag, boolean array)
      Corresponding Type for a given type tag and array flag.
      Type<?> getArrayType()
      Determine the array type which has this type as base type
      Type<?> getBaseType()
      Determine the base type of array types
      int hashCode()  
      boolean isArray()
      Determine whether this is an array type
      int tag()
      Corresponding type tag as defined in PropertyType.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • STRING

        public static final Type<java.lang.String> STRING
        Map String to PropertyType.STRING
      • BINARY

        public static final Type<Blob> BINARY
        Map Blob to PropertyType.BINARY
      • LONG

        public static final Type<java.lang.Long> LONG
        Map Long to PropertyType.LONG
      • DOUBLE

        public static final Type<java.lang.Double> DOUBLE
        Map Double to PropertyType.DOUBLE
      • DATE

        public static final Type<java.lang.String> DATE
        Map String to PropertyType.DATE
      • BOOLEAN

        public static final Type<java.lang.Boolean> BOOLEAN
        Map Boolean to PropertyType.BOOLEAN
      • NAME

        public static final Type<java.lang.String> NAME
        Map String to PropertyType.STRING
      • PATH

        public static final Type<java.lang.String> PATH
        Map String to PropertyType.PATH
      • REFERENCE

        public static final Type<java.lang.String> REFERENCE
        Map String to PropertyType.REFERENCE
      • WEAKREFERENCE

        public static final Type<java.lang.String> WEAKREFERENCE
        Map String to PropertyType.WEAKREFERENCE
      • URI

        public static final Type<java.lang.String> URI
        Map String to PropertyType.URI
      • DECIMAL

        public static final Type<java.math.BigDecimal> DECIMAL
        Map BigDecimal to PropertyType.DECIMAL
      • STRINGS

        public static final Type<java.lang.Iterable<java.lang.String>> STRINGS
        Map Iterable<String> to array of PropertyType.STRING
      • BINARIES

        public static final Type<java.lang.Iterable<Blob>> BINARIES
        Map Iterable<Blob> to array of PropertyType.BINARY
      • LONGS

        public static final Type<java.lang.Iterable<java.lang.Long>> LONGS
        Map Iterable<Long> to array of PropertyType.LONG
      • DOUBLES

        public static final Type<java.lang.Iterable<java.lang.Double>> DOUBLES
        Map Iterable<Double> to array of PropertyType.DOUBLE
      • DATES

        public static final Type<java.lang.Iterable<java.lang.String>> DATES
        Map Iterable<String> to array of PropertyType.DATE
      • BOOLEANS

        public static final Type<java.lang.Iterable<java.lang.Boolean>> BOOLEANS
        Map Iterable<Boolean> to array of PropertyType.BOOLEAN
      • NAMES

        public static final Type<java.lang.Iterable<java.lang.String>> NAMES
        Map Iterable<String> to array of PropertyType.NAME
      • PATHS

        public static final Type<java.lang.Iterable<java.lang.String>> PATHS
        Map Iterable<String> to array of PropertyType.PATH
      • REFERENCES

        public static final Type<java.lang.Iterable<java.lang.String>> REFERENCES
        Map Iterable<String> to array of PropertyType.REFERENCE
      • WEAKREFERENCES

        public static final Type<java.lang.Iterable<java.lang.String>> WEAKREFERENCES
        Map Iterable<String> to array of PropertyType.WEAKREFERENCE
      • URIS

        public static final Type<java.lang.Iterable<java.lang.String>> URIS
        Map Iterable<String> to array of PropertyType.URI
      • DECIMALS

        public static final Type<java.lang.Iterable<java.math.BigDecimal>> DECIMALS
        Map Iterable<BigDecimal> to array of PropertyType.DECIMAL
      • UNDEFINED

        public static final Type<java.lang.Void> UNDEFINED
        The special "undefined" type, never encountered in normal values
      • UNDEFINEDS

        public static final Type<java.lang.Iterable<java.lang.Void>> UNDEFINEDS
        Multi-valued "undefined" type, never encountered in normal values
    • Method Detail

      • tag

        public int tag()
        Corresponding type tag as defined in PropertyType.
        Returns:
        type tag
      • isArray

        public boolean isArray()
        Determine whether this is an array type
        Returns:
        true if and only if this is an array type
      • fromTag

        public static Type<?> fromTag​(int tag,
                                      boolean array)
        Corresponding Type for a given type tag and array flag.
        Parameters:
        tag - type tag as defined in PropertyType.
        array - whether this is an array or not
        Returns:
        Type instance
        Throws:
        java.lang.IllegalArgumentException - if tag is not valid as per definition in PropertyType.
      • fromString

        public static Type<?> fromString​(java.lang.String string)
        Returns the Type with the given string representation.
        Parameters:
        string - type string
        Returns:
        matching type
      • getBaseType

        public Type<?> getBaseType()
        Determine the base type of array types
        Returns:
        base type
        Throws:
        java.lang.IllegalStateException - if isArray is false.
      • getArrayType

        public Type<?> getArrayType()
        Determine the array type which has this type as base type
        Returns:
        array type with this type as base type
        Throws:
        java.lang.IllegalStateException - if isArray is true.
      • compareTo

        public int compareTo​(@NotNull
                             @NotNull Type<?> that)
        Specified by:
        compareTo in interface java.lang.Comparable<T>
      • toString

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object