public class PojoMapper
extends java.lang.Object
IObjects into their corresponding
DataObjects.| Constructor and Description |
|---|
PojoMapper() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends DataObject> |
asCastedDataObjects(java.util.List objects)
Converts each
element of the collection into its
corresponding DataObject. |
static DataObject |
asDataObject(omero.model.IObject object)
Converts the specified
IObject into its corresponding
DataObject. |
static <K,V extends DataObject> |
asDataObjectMap(java.lang.Class<K> keyKlass,
java.lang.Class<V> valueKlass,
java.lang.String method,
java.util.List objects)
Converts each element of the list to a pair (key, value) in the map.
|
static java.util.Map |
asDataObjects(java.util.Map objects)
Converts each pair (key, value) of the map.
|
static <T extends DataObject> |
convertToDataObjects(java.util.Collection objects)
Converts each
element of the collection into its
corresponding DataObject. |
static java.lang.String |
convertTypeForSearch(java.lang.Class nodeType)
Converts the specified type to its corresponding type for search.
|
static java.lang.String |
getGraphType(java.lang.Class<? extends DataObject> dataType)
Returns the name of the data type which has to used for Graph actions,
see
Requests |
static java.lang.String |
getHQLEntityName(java.lang.Class<? extends omero.model.IObject> clazz)
Gets the type of an IObject class as String which can be used in HQL
queries.
|
static java.lang.Class<? extends omero.model.IObject> |
getModelType(java.lang.Class<? extends DataObject> pojoType)
Converts the specified POJO into the corresponding model class.
|
static java.lang.Class<? extends omero.model.IObject> |
getModelType(java.lang.String pojoType)
Converts the specified POJO into the corresponding model class,
see
getModelType(Class) |
static java.lang.Class<? extends DataObject> |
getPojoType(java.lang.Class<? extends omero.model.IObject> modelType)
Get the pojo type for a an
IObject class
(Reverse of getModelType(Class)) |
public static DataObject asDataObject(omero.model.IObject object)
IObject into its corresponding
DataObject.object - The object to convert.java.lang.IllegalArgumentException - If the object is null or
if the type IObject is unknown.public static <T extends DataObject> java.util.Collection<T> convertToDataObjects(java.util.Collection objects)
element of the collection into its
corresponding DataObject.objects - The set of objects to convert.DataObjects.java.lang.IllegalArgumentException - If the set is null, doesn't
contain IObject or if the type IObject is unknown.public static <T extends DataObject> java.util.Collection<T> asCastedDataObjects(java.util.List objects)
element of the collection into its
corresponding DataObject.objects - The set of objects to convert.DataObjects.java.lang.IllegalArgumentException - If the set is null, doesn't
contain IObject or if the type IObject is unknown.public static <K,V extends DataObject> java.util.Map<K,V> asDataObjectMap(java.lang.Class<K> keyKlass, java.lang.Class<V> valueKlass, java.lang.String method, java.util.List objects) throws java.lang.SecurityException, java.lang.NoSuchMethodException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
keyKlass - The class that will be the key for the mapvalueKlass - The class that will be the value for the mapmethod - The method name as a string that, using reflection,
will be used to get the key from the object.objects - The map of objects to convert.java.lang.NoSuchMethodExceptionjava.lang.SecurityExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalArgumentException - If the map is null
or if the type IObject is unknown.public static java.util.Map asDataObjects(java.util.Map objects)
IObject, the element is converted into its corresponding
DataObject.objects - The map of objects to convert.java.lang.IllegalArgumentException - If the map is null
or if the type IObject is unknown.public static java.lang.Class<? extends DataObject> getPojoType(java.lang.Class<? extends omero.model.IObject> modelType)
IObject class
(Reverse of getModelType(Class))modelType - The IObjectpublic static java.lang.Class<? extends omero.model.IObject> getModelType(java.lang.String pojoType)
getModelType(Class)pojoType - The POJO class (Either the simple or the full
class name, e. g. omero.gateway.model.DatasetData or
DatasetData)IObject class.public static java.lang.Class<? extends omero.model.IObject> getModelType(java.lang.Class<? extends DataObject> pojoType)
getPojoType(Class))pojoType - The POJO class.IObject class.public static java.lang.String getGraphType(java.lang.Class<? extends DataObject> dataType)
RequestsdataType - The pojo typepublic static java.lang.String convertTypeForSearch(java.lang.Class nodeType)
nodeType - The type to convert.public static java.lang.String getHQLEntityName(java.lang.Class<? extends omero.model.IObject> clazz)
clazz - The IObject