Class DeviceJsonUtils<T extends DeviceSettings>
- java.lang.Object
-
- org.forgerock.openam.core.rest.devices.DeviceJsonUtils<T>
-
public class DeviceJsonUtils<T extends DeviceSettings> extends Object
Utility functions for ease of conversion between generic DeviceSettings objects and Json representations of those objects.- Since:
- 13.0.0
-
-
Constructor Summary
Constructors Constructor Description DeviceJsonUtils(Class<T> classType)Constructs a new DeviceJsonUtils which will handle device settings of class supplied as the classType param.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TtoDeviceSettingValue(org.forgerock.json.JsonValue jsonValue)Converts aJsonValueobject to theDeviceSettingsobject which it represents.List<T>toDeviceSettingValues(List<org.forgerock.json.JsonValue> jsonValues)org.forgerock.json.JsonValuetoJsonValue(T deviceSetting)Converts anDeviceSettingsobject to aJsonValueobject which represents it.List<org.forgerock.json.JsonValue>toJsonValues(List<T> deviceSettings)
-
-
-
Method Detail
-
toJsonValue
public org.forgerock.json.JsonValue toJsonValue(T deviceSetting) throws IOException
Converts anDeviceSettingsobject to aJsonValueobject which represents it.- Parameters:
deviceSetting- TheDeviceSettingsto convert.- Returns:
- The
JsonValueobject. - Throws:
IOException- if theDeviceSettingsobject could not be converted to aJsonValueobject
-
toDeviceSettingValue
public T toDeviceSettingValue(org.forgerock.json.JsonValue jsonValue) throws IOException
Converts aJsonValueobject to theDeviceSettingsobject which it represents.- Parameters:
jsonValue- TheJsonValueto convert.- Returns:
- The
DeviceSettingsobject. - Throws:
IOException- if theJsonValueobject could not be converted to anDeviceSettingsobject
-
toJsonValues
public List<org.forgerock.json.JsonValue> toJsonValues(List<T> deviceSettings) throws IOException
- Parameters:
deviceSettings- TheListofDeviceSettingsto convert.- Returns:
- The
ListofJsonValueobjects. - Throws:
IOException- if anyDeviceSettingsobject could not be converted to aJsonValueobject
-
toDeviceSettingValues
public List<T> toDeviceSettingValues(List<org.forgerock.json.JsonValue> jsonValues) throws IOException
- Parameters:
jsonValues- TheListofJsonValueto convert.- Returns:
- The
ListofDeviceSettingsobjects. - Throws:
IOException- if anyJsonValueobject could not be converted to anDeviceSettingsobject
-
-