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 T
toDeviceSettingValue(org.forgerock.json.JsonValue jsonValue)
Converts aJsonValue
object to theDeviceSettings
object which it represents.List<T>
toDeviceSettingValues(List<org.forgerock.json.JsonValue> jsonValues)
org.forgerock.json.JsonValue
toJsonValue(T deviceSetting)
Converts anDeviceSettings
object to aJsonValue
object 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 anDeviceSettings
object to aJsonValue
object which represents it.- Parameters:
deviceSetting
- TheDeviceSettings
to convert.- Returns:
- The
JsonValue
object. - Throws:
IOException
- if theDeviceSettings
object could not be converted to aJsonValue
object
-
toDeviceSettingValue
public T toDeviceSettingValue(org.forgerock.json.JsonValue jsonValue) throws IOException
Converts aJsonValue
object to theDeviceSettings
object which it represents.- Parameters:
jsonValue
- TheJsonValue
to convert.- Returns:
- The
DeviceSettings
object. - Throws:
IOException
- if theJsonValue
object could not be converted to anDeviceSettings
object
-
toJsonValues
public List<org.forgerock.json.JsonValue> toJsonValues(List<T> deviceSettings) throws IOException
- Parameters:
deviceSettings
- TheList
ofDeviceSettings
to convert.- Returns:
- The
List
ofJsonValue
objects. - Throws:
IOException
- if anyDeviceSettings
object could not be converted to aJsonValue
object
-
toDeviceSettingValues
public List<T> toDeviceSettingValues(List<org.forgerock.json.JsonValue> jsonValues) throws IOException
- Parameters:
jsonValues
- TheList
ofJsonValue
to convert.- Returns:
- The
List
ofDeviceSettings
objects. - Throws:
IOException
- if anyJsonValue
object could not be converted to anDeviceSettings
object
-
-