public final class DataType extends Object implements AutoCloseable
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.
DataProperty
Modifier and Type | Class and Description |
---|---|
static class |
DataType.Builder
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object other) |
protected void |
finalize() |
DataProperty |
findDataProperty(String name)
Searches for a data property by name.
|
List<DataAnnotation> |
getAnnotations() |
static DataType |
getBooleanType() |
List<DataProperty> |
getDataProperties() |
static DataType |
getDoubleType() |
static DataType |
getFloatType() |
static DataType |
getGeometryType() |
static DataType |
getIntType() |
static DataType |
getLongType() |
String |
getName() |
static DataType |
getStringType() |
boolean |
hasDataProperty(DataProperty property)
Checks if the given property is declared in this data type.
|
int |
hashCode() |
boolean |
isPrimitive() |
static DataType.Builder |
newBuilder()
Creates a new
DataType builder. |
String |
toString() |
public void close()
close
in interface AutoCloseable
@NotNull public static DataType.Builder newBuilder()
DataType
builder.DataType
builder.@NotNull public static DataType getGeometryType()
Geometry
values.@NotNull public static DataType getIntType()
int32_t
values.@NotNull public static DataType getLongType()
int64_t
values.@NotNull public static DataType getFloatType()
float
values.@NotNull public static DataType getDoubleType()
double
values.@NotNull public static DataType getStringType()
std::string
values.@NotNull public static DataType getBooleanType()
bool
values.@NotNull public List<DataAnnotation> getAnnotations()
@NotNull public String getName()
@NotNull public List<DataProperty> getDataProperties()
@Nullable public DataProperty findDataProperty(@NotNull String name)
name
- the name of a propertyhasDataProperty
public boolean hasDataProperty(@NotNull DataProperty property)
property
- Data property.findDataProperty
public boolean isPrimitive()