Module com.gluonhq.cloudlink.client
Class SerializationUtils
- java.lang.Object
-
- com.gluonhq.impl.cloudlink.client.data.metadata.SerializationUtils
-
public class SerializationUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description SerializationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectdeserializeMapInfo(javax.json.JsonObject info)static <T> ConnectMetadata<T>getOrCreateObjectMetadata(Class<T> clazz)Helper method for obtaining the ConnectMetadata for the specified class.static <T> ObjectgetProperty(Field field, T target)static ObjectreadMapObject(javax.json.JsonObject json, String fieldName, Class<?> fieldType)static ObjectreadObject(javax.json.JsonObject json, Field field)static <T> voidreadProperty(javax.json.JsonObject json, Field field, T target)static voidserializeJsonObjectToMap(javax.json.JsonObject json, Map<String,Object> target)static StringserializeToString(javax.json.JsonObject jsonObject)static <T> voidwriteProperty(javax.json.JsonObjectBuilder jsonObjectBuilder, Field field, T target)static voidwriteProperty(javax.json.JsonObjectBuilder jsonObjectBuilder, String key, Object value)
-
-
-
Method Detail
-
getOrCreateObjectMetadata
public static <T> ConnectMetadata<T> getOrCreateObjectMetadata(Class<T> clazz)
Helper method for obtaining the ConnectMetadata for the specified class.- Parameters:
clazz- the class to inspect- Returns:
- connect metadata for the specified class
-
serializeToString
public static String serializeToString(javax.json.JsonObject jsonObject)
-
getProperty
public static <T> Object getProperty(Field field, T target) throws IllegalAccessException
- Throws:
IllegalAccessException
-
writeProperty
public static <T> void writeProperty(javax.json.JsonObjectBuilder jsonObjectBuilder, Field field, T target) throws IllegalAccessException- Throws:
IllegalAccessException
-
writeProperty
public static void writeProperty(javax.json.JsonObjectBuilder jsonObjectBuilder, String key, Object value)
-
readProperty
public static <T> void readProperty(javax.json.JsonObject json, Field field, T target) throws IllegalAccessException- Throws:
IllegalAccessException
-
readMapObject
public static Object readMapObject(javax.json.JsonObject json, String fieldName, Class<?> fieldType)
-
serializeJsonObjectToMap
public static void serializeJsonObjectToMap(javax.json.JsonObject json, Map<String,Object> target)
-
deserializeMapInfo
public static Object deserializeMapInfo(javax.json.JsonObject info)
-
-