Class Type<T>

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

    public final class Type<T>
    extends Object
    implements 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 Detail

      • STRING

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static final Type<Iterable<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:
        IllegalArgumentException - if tag is not valid as per definition in PropertyType.
      • fromString

        public static Type<?> fromString​(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:
        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:
        IllegalStateException - if isArray is true.
      • compareTo

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

        public int hashCode()
        Overrides:
        hashCode in class Object