Class DataType

java.lang.Object
com.luciad.datamodels.DataType
All Implemented Interfaces:
AutoCloseable

public final class DataType extends Object implements AutoCloseable
A representation of the type of a data object.

A type describes the structure of a data object as a list of properties. Each of these properties is itself of a certain type.

A type is either a primitive type or a data object type. Primitive types are types which have no internal structure (no properties) and typically represent simple object such as strings, numbers etc. All primitive types are accessible from this class (see e.g. getIntType(), getStringType() ...).

Application-specific metadata can be attached to a type in the form of a DataAnnotation.

New types can be defined using a DataType.Builder (see newBuilder()).

Instances of this class are thread safe. Once an instance has been created, there is no public API to modify it.

See Also:
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • newBuilder

      @NotNull public static DataType.Builder newBuilder()
      Creates a new DataType builder.
      Returns:
      a new DataType builder.
    • getGeometryType

      @NotNull public static DataType getGeometryType()
      Returns the type that corresponds to Geometry values.
      Returns:
      the type that corresponds to Geometry values.
    • getIntType

      @NotNull public static DataType getIntType()
      Returns the type that corresponds to int32_t values.
      Returns:
      the type that corresponds to int32_t values.
    • getLongType

      @NotNull public static DataType getLongType()
      Returns the type that corresponds to int64_t values.
      Returns:
      the type that corresponds to int64_t values.
    • getFloatType

      @NotNull public static DataType getFloatType()
      Returns the type that corresponds to float values.
      Returns:
      the type that corresponds to float values.
    • getDoubleType

      @NotNull public static DataType getDoubleType()
      Returns the type that corresponds to double values.
      Returns:
      the type that corresponds to double values.
    • getStringType

      @NotNull public static DataType getStringType()
      Returns the type that corresponds to std::string values.
      Returns:
      the type that corresponds to std::string values.
    • getBooleanType

      @NotNull public static DataType getBooleanType()
      Returns the type that corresponds to bool values.
      Returns:
      the type that corresponds to bool values.
    • getAnnotations

      @NotNull public List<@NotNull DataAnnotation> getAnnotations()
      Returns the list of annotations attached to this data type.
      Returns:
      the list of annotations attached to this data type.
    • getName

      @NotNull public String getName()
      Returns the name of this data type.
      Returns:
      the name of this data type.
    • getDataProperties

      @NotNull public List<@NotNull DataProperty> getDataProperties()
      Returns the list of properties of this data type.
      Returns:
      the list of properties of this data type.
    • findDataProperty

      @Nullable public DataProperty findDataProperty(@NotNull String name)
      Searches for a data property by name.
      Parameters:
      name - the name of a property
      Returns:
      the data property with the given name, if available
      See Also:
    • hasDataProperty

      public boolean hasDataProperty(@NotNull DataProperty property)
      Returns if the given property is declared in this data type.
      Parameters:
      property - Data property.
      Returns:
      if the given property is declared in this data type.
      See Also:
    • isPrimitive

      public boolean isPrimitive()
      Returns whether this is a primitive type, i.e.

      a type without any properties.

      Returns:
      whether this is a primitive type, i.e. a type without any properties.
    • toString

      @NotNull public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Returns the hash code.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code.
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object