T
- the type of the valuepublic abstract class NamedData<T> extends ComplexData<NamedData<T>>
Modifier | Constructor and Description |
---|---|
protected |
NamedData(java.lang.String name,
T value) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Creates a map containing all the individual data points composing this complex data object.
|
java.lang.String |
getName() |
T |
getValue() |
java.lang.String |
toString() |
changesFrom
protected NamedData(java.lang.String name, T value)
public java.util.Map<java.lang.String,java.lang.Object> asMap()
ComplexData
public class Point extends ComplexData<Point> {
private final double x;
private final double y;
}
should put the values of x
and y
into this map, with the keys "x"
and "y"
,
respectively. Note that these keys do not have to be the same as the field names, and may be completely arbitrary.
But the keys do have to be the same as those used by the corresponding ComplexDataType
to convert
a Map<String, Object>
to an instance of this class.asMap
in class ComplexData<NamedData<T>>
public final java.lang.String getName()
public final T getValue()
public java.lang.String toString()
toString
in class java.lang.Object