Package com.identityworksllc.iiq.common
Class SailpointObjectMapper<T>
- java.lang.Object
-
- com.identityworksllc.iiq.common.ObjectMapper<T>
-
- com.identityworksllc.iiq.common.SailpointObjectMapper<T>
-
- Type Parameters:
T
- The mapper output type
public class SailpointObjectMapper<T> extends ObjectMapper<T>
An extension of ObjectMapper to handle SailPointObject types
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SailpointObjectMapper.SailPointTypeNamer
Overrides the mapping from Class to class name to include the plugin cache version.-
Nested classes/interfaces inherited from class com.identityworksllc.iiq.common.ObjectMapper
ObjectMapper.AfterMapperMethod, ObjectMapper.Aliases, ObjectMapper.Convertible, ObjectMapper.DefaultTypeNamer, ObjectMapper.Ignore, ObjectMapper.IgnoreSuper, ObjectMapper.Nested, ObjectMapper.ObjectMapperException, ObjectMapper.RawMap, ObjectMapper.SetterMethod, ObjectMapper.TypeNamer
-
-
Constructor Summary
Constructors Constructor Description SailpointObjectMapper(Class<T> targetClass)
Basic constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertObject(Object value, Class<?> expectedType)
Converts the given object to the expected type.T
decode(sailpoint.object.Configuration configuration)
Decodes the given Configuration object into an instance of the mapped type.T
decode(sailpoint.object.Configuration configuration, boolean cache)
Decodes the given Configuration object into an instance of the mapped type.T
decode(sailpoint.object.Custom configuration)
Decodes the given Custom object into an instance of the mapped type.T
decode(sailpoint.object.Custom configuration, boolean cache)
Decodes the given Custom object into an instance of the mapped type.static <T> T
fromConfiguration(sailpoint.api.SailPointContext context, String configName, Class<T> type)
Returns the object mapped from the given Configurationstatic sailpoint.tools.GeneralException
unwrap(ObjectMapper.ObjectMapperException e)
Transform the object mapper exception into a GeneralException as needed-
Methods inherited from class com.identityworksllc.iiq.common.ObjectMapper
decode, decode, get, getTargetClass, isNotNullOrEmpty, otoa, otob, otol
-
-
-
-
Constructor Detail
-
SailpointObjectMapper
public SailpointObjectMapper(Class<T> targetClass)
Basic constructor.You should prefer
ObjectMapper.get(Class)
to this.- Parameters:
targetClass
- the target class
-
-
Method Detail
-
fromConfiguration
public static <T> T fromConfiguration(sailpoint.api.SailPointContext context, String configName, Class<T> type) throws sailpoint.tools.GeneralException, ObjectMapper.ObjectMapperException
Returns the object mapped from the given Configuration- Type Parameters:
T
- The output type- Parameters:
context
- The context to use to get the Configuration objectconfigName
- The configuration nametype
- the output type- Returns:
- An instance of the mapped configuration object
- Throws:
sailpoint.tools.GeneralException
- if any failures occurObjectMapper.ObjectMapperException
-
unwrap
public static sailpoint.tools.GeneralException unwrap(ObjectMapper.ObjectMapperException e)
Transform the object mapper exception into a GeneralException as needed- Parameters:
e
- The exception to unwrap or wrap- Returns:
- an appropriate GeneralException
-
convertObject
public Object convertObject(Object value, Class<?> expectedType) throws ObjectMapper.ObjectMapperException
Converts the given object to the expected type.If the input is null, a null will be returned. If the input is already compatible with the expected type, the existing object will be returned. If the input cannot be converted, an exception will be thrown.
- Overrides:
convertObject
in classObjectMapper<T>
- Parameters:
value
- The input valueexpectedType
- The expected type of the input- Returns:
- The converted object
- Throws:
ObjectMapper.ObjectMapperException
-
decode
public T decode(sailpoint.object.Custom configuration) throws sailpoint.tools.GeneralException, ObjectMapper.ObjectMapperException
Decodes the given Custom object into an instance of the mapped type.- Parameters:
configuration
- The Custom object to convert- Returns:
- An object of the expected type
- Throws:
sailpoint.tools.GeneralException
- if any failure occurObjectMapper.ObjectMapperException
-
decode
public T decode(sailpoint.object.Custom configuration, boolean cache) throws sailpoint.tools.GeneralException, ObjectMapper.ObjectMapperException
Decodes the given Custom object into an instance of the mapped type.- Parameters:
configuration
- The Custom object to convertcache
- If true, the cached value will be returned if possible- Returns:
- An object of the expected type
- Throws:
sailpoint.tools.GeneralException
- if any failure occurObjectMapper.ObjectMapperException
-
decode
public T decode(sailpoint.object.Configuration configuration) throws sailpoint.tools.GeneralException, ObjectMapper.ObjectMapperException
Decodes the given Configuration object into an instance of the mapped type.- Parameters:
configuration
- The Configuration object to convert- Returns:
- An object of the expected type
- Throws:
sailpoint.tools.GeneralException
- if any failure occurObjectMapper.ObjectMapperException
-
decode
public T decode(sailpoint.object.Configuration configuration, boolean cache) throws sailpoint.tools.GeneralException, ObjectMapper.ObjectMapperException
Decodes the given Configuration object into an instance of the mapped type.- Parameters:
configuration
- The Configuration object to convertcache
- If true, the cached value will be returned if possible- Returns:
- An object of the expected type
- Throws:
sailpoint.tools.GeneralException
- if any failure occurObjectMapper.ObjectMapperException
-
-