Module com.gluonhq.cloudlink.client
Class ConnectMetadataClass<T>
- java.lang.Object
-
- com.gluonhq.impl.cloudlink.client.data.metadata.ConnectMetadataClass<T>
-
- All Implemented Interfaces:
ConnectMetadata<T>
public class ConnectMetadataClass<T> extends Object implements ConnectMetadata<T>
-
-
Constructor Summary
Constructors Constructor Description ConnectMetadataClass(Class<T> targetClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToJson(javax.json.JsonObjectBuilder jsonObjectBuilder, String fieldName, T object)
void
addToObject(String fieldName, javax.json.JsonObject jsonObject, T object)
T
deserialize(String json)
T
deserialize(javax.json.JsonObject jsonObject)
Object
deserializeField(String fieldName, javax.json.JsonObject jsonObject)
Field
getFieldByName(String name)
Returns a field that is defined on the target class that has the same name as the specified name.List<Field>
getFields()
Returns a list of all the fields that are defined on the target class.List<Field>
getFields(Class<?> type)
Returns a list of all the fields that are defined on the target class and that are of the specified type.Object
getFieldValue(String fieldName, T object)
Map<String,ObservableList>
getObservableLists(T target)
Map<String,ObservableValue>
getObservables(T target)
Returns a map with all the observables that can actively be listened on.Class<T>
getTargetClass()
Returns the class where this metadata was generated from.T
instantiate(Map<String,javax.json.JsonObject> fieldMap)
javax.json.JsonObject
serialize(T object)
javax.json.JsonObject
serializeField(String fieldName, T object)
-
-
-
Method Detail
-
getTargetClass
public Class<T> getTargetClass()
Returns the class where this metadata was generated from.- Specified by:
getTargetClass
in interfaceConnectMetadata<T>
- Returns:
-
getFields
public List<Field> getFields()
Returns a list of all the fields that are defined on the target class.- Returns:
-
getFields
public List<Field> getFields(Class<?> type)
Returns a list of all the fields that are defined on the target class and that are of the specified type.- Returns:
-
getFieldByName
public Field getFieldByName(String name)
Returns a field that is defined on the target class that has the same name as the specified name.- Parameters:
name
- the name of the field to look for- Returns:
-
getObservables
public Map<String,ObservableValue> getObservables(T target)
Description copied from interface:ConnectMetadata
Returns a map with all the observables that can actively be listened on. The keys are strings that uniquely map to a single field in the metadata. The values are instances of ObservableValue.- Specified by:
getObservables
in interfaceConnectMetadata<T>
- Returns:
-
getObservableLists
public Map<String,ObservableList> getObservableLists(T target)
- Specified by:
getObservableLists
in interfaceConnectMetadata<T>
-
instantiate
public T instantiate(Map<String,javax.json.JsonObject> fieldMap)
- Specified by:
instantiate
in interfaceConnectMetadata<T>
-
getFieldValue
public Object getFieldValue(String fieldName, T object)
- Specified by:
getFieldValue
in interfaceConnectMetadata<T>
-
deserializeField
public Object deserializeField(String fieldName, javax.json.JsonObject jsonObject)
- Specified by:
deserializeField
in interfaceConnectMetadata<T>
-
serializeField
public javax.json.JsonObject serializeField(String fieldName, T object)
- Specified by:
serializeField
in interfaceConnectMetadata<T>
-
addToObject
public void addToObject(String fieldName, javax.json.JsonObject jsonObject, T object)
- Specified by:
addToObject
in interfaceConnectMetadata<T>
-
addToJson
public void addToJson(javax.json.JsonObjectBuilder jsonObjectBuilder, String fieldName, T object)
- Specified by:
addToJson
in interfaceConnectMetadata<T>
-
deserialize
public T deserialize(javax.json.JsonObject jsonObject)
- Specified by:
deserialize
in interfaceConnectMetadata<T>
-
deserialize
public T deserialize(String json)
- Specified by:
deserialize
in interfaceConnectMetadata<T>
-
serialize
public javax.json.JsonObject serialize(T object)
- Specified by:
serialize
in interfaceConnectMetadata<T>
-
-