Package ome.util
Class Utils
- java.lang.Object
-
- ome.util.Utils
-
public class Utils extends java.lang.Objectvarious tools needed throughout Omero.- Since:
- 1.0 TODO Grinder issues should be moved to test component to reduce deps.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCGLIB_IDENTIFIERprotected static java.lang.StringJVST_IDENTIFIER
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseQuietly(java.io.Closeable is)static <T> java.lang.String[]getObjectVoidMethods(java.lang.Class<T> clazz)primarily used in Grinder to discover what methods to callstatic java.lang.StringgetThreadIdentifier()Returns aStringwhich can be used to correlate log messages.static java.lang.ObjectinternalForm(Permissions p)Returns the internal representation of aPermissionsobject.static PermissionstoPermissions(java.lang.Object o)Returns aPermissionsinstance from its internal representation.static <T extends IObject>
java.lang.Class<T>trueClass(java.lang.Class<T> source)finds the "true" class identified by a given Class object.static <T extends IObject>
TtrueInstance(java.lang.Class<T> source)instantiates an object using the trueClass.
-
-
-
Field Detail
-
CGLIB_IDENTIFIER
protected static final java.lang.String CGLIB_IDENTIFIER
- See Also:
- Constant Field Values
-
JVST_IDENTIFIER
protected static final java.lang.String JVST_IDENTIFIER
- See Also:
- Constant Field Values
-
-
Method Detail
-
trueClass
public static <T extends IObject> java.lang.Class<T> trueClass(java.lang.Class<T> source)
finds the "true" class identified by a given Class object. This is necessary because of possibly proxied instances.- Parameters:
source- Regular or CGLIB-based class.- Returns:
- the regular Java class.
-
trueInstance
public static <T extends IObject> T trueInstance(java.lang.Class<T> source)
instantiates an object using the trueClass.- Parameters:
source- Regular or CGLIB-based class.- Returns:
- the regular Java instance.
-
getObjectVoidMethods
public static <T> java.lang.String[] getObjectVoidMethods(java.lang.Class<T> clazz)
primarily used in Grinder to discover what methods to call- Parameters:
clazz-
-
internalForm
public static java.lang.Object internalForm(Permissions p)
Returns the internal representation of aPermissionsobject. Should be used with caution!
-
toPermissions
public static Permissions toPermissions(java.lang.Object o)
Returns aPermissionsinstance from its internal representation. Should be used with caution!
-
getThreadIdentifier
public static java.lang.String getThreadIdentifier()
Returns aStringwhich can be used to correlate log messages.
-
closeQuietly
public static void closeQuietly(java.io.Closeable is)
-
-