public abstract class rtypes
extends java.lang.Object
Arrays
or
Collections
which is responsible for creating RTypes from
static factory methods. Where possible, factory methods return cached values
(the fly-weight pattern) such that rbool(true) == rbool(true)
might hold true.
This class is fairly non-traditional Java and instead is more like a Python
module or static methods in C++ to keep the three language bindings fairly in
step.Modifier and Type | Class and Description |
---|---|
static interface |
rtypes.Conversion
SPI-style interface which helps the omero server to properly convert
omero.RType objects into Java-native objects for use in Hibernate.
|
static class |
rtypes.RTypeObjectFactoryRegistry |
Constructor and Description |
---|
rtypes() |
Modifier and Type | Method and Description |
---|---|
static RArray |
rarray(java.util.Collection<RType> val) |
static RArray |
rarray(RType... val) |
static RBool |
rbool(boolean val) |
static RClass |
rclass(java.lang.String val) |
static RDouble |
rdouble(double val) |
static RFloat |
rfloat(float val) |
static RInt |
rint(int val) |
static RInternal |
rinternal(Internal val) |
static RList |
rlist(java.util.Collection<RType> val) |
static RList |
rlist(RType... val) |
static RLong |
rlong(long val) |
static RMap |
rmap() |
static RMap |
rmap(java.util.Map<java.lang.String,RType> val) |
static RMap |
rmap(java.lang.String key,
RType val) |
static RObject |
robject(IObject val) |
static RSet |
rset(java.util.Collection<RType> val) |
static RSet |
rset(RType... val) |
static RString |
rstring(java.lang.String val) |
static RTime |
rtime_max() |
static RTime |
rtime_min() |
static RTime |
rtime_str(java.lang.String tstr) |
static RTime |
rtime(java.util.Date date) |
static RTime |
rtime(long val) |
static RType |
rtype(java.lang.Object obj)
Attempts to dispatch to the other omero.rtypes.* static methods
to create a proper
RType subclass by checking the type
of the input. |
static java.lang.Object |
unwrap(RType value)
Descends into data structures unwrapping all RType objects as it goes.
|
static java.lang.Object |
unwrap(RType value,
java.util.Map<RType,java.lang.Object> cache)
Descends into data structures wrapping all elements as it goes.
|
protected static void |
unwrapCollection(java.util.Collection<RType> rtypes,
java.util.Collection<java.lang.Object> rv,
java.util.Map<RType,java.lang.Object> cache) |
static RType |
wrap(java.lang.Object value)
Descends into data structures wrapping all elements as it goes.
|
static RType |
wrap(java.lang.Object value,
java.util.Map<java.lang.Object,RType> cache)
Descends into data structures wrapping all elements as it goes.
|
public static RType rtype(java.lang.Object obj)
RType
subclass by checking the type
of the input. If null is given, null is returned. Otherwise, where
possible an RType
is returned, else ClientError
is
thrown.public static RType wrap(java.lang.Object value)
wrap(Object, Map)
with a new cache argument.value
- the value to wrappublic static RType wrap(java.lang.Object value, java.util.Map<java.lang.Object,RType> cache)
value
- the value to wrapcache
- a cache of wrapped values (to be expanded by misses)ClientError
- if all else fails.public static java.lang.Object unwrap(RType value)
List
instances!
Calls unwrap(RType, Map)
with a new cache argument.value
- the wrapped valuepublic static java.lang.Object unwrap(RType value, java.util.Map<RType,java.lang.Object> cache)
List
instances!
The cache argument is used to prevent cycles.value
- the wrapped valuecache
- a cache of unwrapped values (to be expanded by misses)protected static void unwrapCollection(java.util.Collection<RType> rtypes, java.util.Collection<java.lang.Object> rv, java.util.Map<RType,java.lang.Object> cache)
public static RBool rbool(boolean val)
public static RDouble rdouble(double val)
public static RFloat rfloat(float val)
public static RInt rint(int val)
public static RLong rlong(long val)
public static RTime rtime(long val)
public static RTime rtime(java.util.Date date)
public static RTime rtime_min()
public static RTime rtime_max()
public static RTime rtime_str(java.lang.String tstr)
public static RClass rclass(java.lang.String val)
public static RString rstring(java.lang.String val)
public static RMap rmap()