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 Object
deserializeMapInfo(javax.json.JsonObject info)
static <T> ConnectMetadata<T>
getOrCreateObjectMetadata(Class<T> clazz)
Helper method for obtaining the ConnectMetadata for the specified class.static <T> Object
getProperty(Field field, T target)
static Object
readMapObject(javax.json.JsonObject json, String fieldName, Class<?> fieldType)
static Object
readObject(javax.json.JsonObject json, Field field)
static <T> void
readProperty(javax.json.JsonObject json, Field field, T target)
static void
serializeJsonObjectToMap(javax.json.JsonObject json, Map<String,Object> target)
static String
serializeToString(javax.json.JsonObject jsonObject)
static <T> void
writeProperty(javax.json.JsonObjectBuilder jsonObjectBuilder, Field field, T target)
static void
writeProperty(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)
-
-