Package ome.util
Class Utils
- java.lang.Object
-
- ome.util.Utils
-
public class Utils extends java.lang.Object
various 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.String
CGLIB_IDENTIFIER
protected static java.lang.String
JVST_IDENTIFIER
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeQuietly(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.String
getThreadIdentifier()
Returns aString
which can be used to correlate log messages.static java.lang.Object
internalForm(Permissions p)
Returns the internal representation of aPermissions
object.static Permissions
toPermissions(java.lang.Object o)
Returns aPermissions
instance 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 aPermissions
object. Should be used with caution!
-
toPermissions
public static Permissions toPermissions(java.lang.Object o)
Returns aPermissions
instance from its internal representation. Should be used with caution!
-
getThreadIdentifier
public static java.lang.String getThreadIdentifier()
Returns aString
which can be used to correlate log messages.
-
closeQuietly
public static void closeQuietly(java.io.Closeable is)
-
-