Package omero
Class rtypes
- java.lang.Object
-
- omero.rtypes
-
public abstract class rtypes extends java.lang.Object
Abstract class similar toArrays
orCollections
which is responsible for creating RTypes from static factory methods. Where possible, factory methods return cached values (the fly-weight pattern) such thatrbool(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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 Summary
Constructors Constructor Description rtypes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.lang.String key, RType val)
static RMap
rmap(java.util.Map<java.lang.String,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(long val)
static RTime
rtime(java.util.Date date)
static RTime
rtime_max()
static RTime
rtime_min()
static RTime
rtime_str(java.lang.String tstr)
static RType
rtype(java.lang.Object obj)
Attempts to dispatch to the other omero.rtypes.* static methods to create a properRType
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.
-
-
-
Method Detail
-
rtype
public static RType rtype(java.lang.Object obj)
Attempts to dispatch to the other omero.rtypes.* static methods to create a properRType
subclass by checking the type of the input. If null is given, null is returned. Otherwise, where possible anRType
is returned, elseClientError
is thrown.
-
wrap
public static RType wrap(java.lang.Object value)
Descends into data structures wrapping all elements as it goes. Limitation: All map keys will be converted to strings! Callswrap(Object, Map)
with a new cache argument.- Parameters:
value
- the value to wrap- Returns:
- the wrapped value
-
wrap
public 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. Limitation: All map keys will be converted to strings! The cache argument is used to prevent cycles.- Parameters:
value
- the value to wrapcache
- a cache of wrapped values (to be expanded by misses)- Returns:
- the wrapped value
- Throws:
ClientError
- if all else fails.
-
unwrap
public static java.lang.Object unwrap(RType value)
Descends into data structures unwrapping all RType objects as it goes. Limitation: RArrays are turned intoList
instances! Callsunwrap(RType, Map)
with a new cache argument.- Parameters:
value
- the wrapped value- Returns:
- the value unwrapped
-
unwrap
public 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. Limitation: RArrays are turned intoList
instances! The cache argument is used to prevent cycles.- Parameters:
value
- the wrapped valuecache
- a cache of unwrapped values (to be expanded by misses)- Returns:
- the value unwrapped
-
unwrapCollection
protected static void unwrapCollection(java.util.Collection<RType> rtypes, java.util.Collection<java.lang.Object> rv, java.util.Map<RType,java.lang.Object> cache)
-
rbool
public static RBool rbool(boolean val)
-
rdouble
public static RDouble rdouble(double val)
-
rfloat
public static RFloat rfloat(float val)
-
rint
public static RInt rint(int val)
-
rlong
public static RLong rlong(long val)
-
rtime
public static RTime rtime(long val)
-
rtime
public static RTime rtime(java.util.Date date)
-
rtime_min
public static RTime rtime_min()
-
rtime_max
public static RTime rtime_max()
-
rtime_str
public static RTime rtime_str(java.lang.String tstr)
-
rclass
public static RClass rclass(java.lang.String val)
-
rstring
public static RString rstring(java.lang.String val)
-
rmap
public static RMap rmap()
-
-