public abstract class Datatype<T> extends Object
Modifier and Type | Field and Description |
---|---|
static Datatype<Boolean> |
BOOL
Boolean type.
|
static Datatype<Double> |
FLOAT
Floating point type.
|
static Datatype<Long> |
INT
Integer type.
|
static Datatype<String> |
STRING
String type.
|
Modifier and Type | Method and Description |
---|---|
abstract T |
decode(String txt)
Decodes a string value that has this type.
|
static Datatype<?> |
forName(String name)
Returns the datatype instance for a given type name.
|
String |
getName()
Returns the name of this datatype, as used in the datatype member
of a field.
|
Class<T> |
getTypeClass()
Returns the object class represented by this datatype.
|
abstract boolean |
isType(String txt)
Indicates whether a string value appears to have this type.
|
String |
toString() |
public String getName()
public Class<T> getTypeClass()
public abstract T decode(String txt)
txt
- JSON string representation of a typed valueRuntimeException
- if the value cannot be decodedpublic abstract boolean isType(String txt)
decode(java.lang.String)
should return a value
without error.txt
- JSON string representation of a typed valueCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.