Enum PropertyTypeName.BaseType
- java.lang.Object
-
- java.lang.Enum<PropertyTypeName.BaseType>
-
- org.gcube.informationsystem.types.PropertyTypeName.BaseType
-
- All Implemented Interfaces:
Serializable,Comparable<PropertyTypeName.BaseType>
- Enclosing class:
- PropertyTypeName
public static enum PropertyTypeName.BaseType extends Enum<PropertyTypeName.BaseType>
The fundamental data types for properties.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANYA generic opaque object mapping to any supported type.BINARYBinary data payload.BOOLEANA standard true/false boolean value.BYTEA single byte.DATEA timestamp.DOUBLEA double-precision 64-bit floating point.FLOATA single-precision 32-bit floating point.INTEGERA 32-bit signed integer.JSON_ARRAYA generic JSON Array.JSON_OBJECTA generic JSON Object.LISTAn ordered collection of values of a single element type.LONGA 64-bit signed integer.MAPA collection of key-value pairs; keys must be String, values share a single element type.PROPERTYA reference to another Property-family type, embedded inline (Schema-Mixed Mode).SETAn unordered collection of unique values of a single element type.SHORTA 16-bit signed integer.STRINGA sequence of characters.
-
Field Summary
Fields Modifier and Type Field Description protected static Map<String,PropertyTypeName.BaseType>mapA map of base types, keyed by string representation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyTypeName.BaseTypegetBaseTypeFromString(String type)Returns theBaseTypeenum constant from its string representation.StringgetDescription()Returns a human-readable description of this base type, e.g.Class<?>getMappedClass()Returns the canonical Java class this base type is mapped to, e.g.StringtoString()static PropertyTypeName.BaseTypevalueOf(String name)Returns the enum constant of this type with the specified name.static PropertyTypeName.BaseType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY
public static final PropertyTypeName.BaseType ANY
A generic opaque object mapping to any supported type.
-
BOOLEAN
public static final PropertyTypeName.BaseType BOOLEAN
A standard true/false boolean value.
-
INTEGER
public static final PropertyTypeName.BaseType INTEGER
A 32-bit signed integer. Evaluates Min/Max attributes if provided in the schema.
-
SHORT
public static final PropertyTypeName.BaseType SHORT
A 16-bit signed integer. Evaluates Min/Max attributes if provided in the schema.
-
LONG
public static final PropertyTypeName.BaseType LONG
A 64-bit signed integer. Evaluates Min/Max attributes if provided in the schema.
-
FLOAT
public static final PropertyTypeName.BaseType FLOAT
A single-precision 32-bit floating point. Evaluates Min/Max attributes if provided.
-
DOUBLE
public static final PropertyTypeName.BaseType DOUBLE
A double-precision 64-bit floating point. Evaluates Min/Max attributes if provided.
-
DATE
public static final PropertyTypeName.BaseType DATE
A timestamp. It must be provided in the strictly expected format (yyyy-MM-dd HH:mm:ss.SSS Z).
-
STRING
public static final PropertyTypeName.BaseType STRING
A sequence of characters. Can be constrained by a Regular Expression using the Regex schema attribute.
-
BINARY
public static final PropertyTypeName.BaseType BINARY
Binary data payload. In the JSON representation, this is encoded as a base64 string.
-
BYTE
public static final PropertyTypeName.BaseType BYTE
A single byte. In the JSON representation, it is formatted as a standard JSON number (from -128 to 127).
-
JSON_OBJECT
public static final PropertyTypeName.BaseType JSON_OBJECT
A generic JSON Object.
-
JSON_ARRAY
public static final PropertyTypeName.BaseType JSON_ARRAY
A generic JSON Array.
-
PROPERTY
public static final PropertyTypeName.BaseType PROPERTY
A reference to another Property-family type, embedded inline (Schema-Mixed Mode).
-
LIST
public static final PropertyTypeName.BaseType LIST
An ordered collection of values of a single element type.
-
SET
public static final PropertyTypeName.BaseType SET
An unordered collection of unique values of a single element type.
-
MAP
public static final PropertyTypeName.BaseType MAP
A collection of key-value pairs; keys must be String, values share a single element type.
-
-
Field Detail
-
map
protected static final Map<String,PropertyTypeName.BaseType> map
A map of base types, keyed by string representation.
-
-
Method Detail
-
values
public static PropertyTypeName.BaseType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PropertyTypeName.BaseType c : PropertyTypeName.BaseType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PropertyTypeName.BaseType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
toString
public String toString()
- Overrides:
toStringin classEnum<PropertyTypeName.BaseType>
-
getMappedClass
public Class<?> getMappedClass()
Returns the canonical Java class this base type is mapped to, e.g. for documentation generation. Several other classes may also resolve to this base type (seePropertyTypeName.getBaseTypeByClass(Class)) -- this is the single, primary one.- Returns:
- The mapped class.
-
getDescription
public String getDescription()
Returns a human-readable description of this base type, e.g. for documentation generation.- Returns:
- The description.
-
getBaseTypeFromString
public static PropertyTypeName.BaseType getBaseTypeFromString(String type)
Returns theBaseTypeenum constant from its string representation.- Parameters:
type- The string representation of the type.- Returns:
- The corresponding
BaseType. - Throws:
IllegalArgumentException- if the string does not match any known base type.
-
-