Package omero
Class rtypes
- java.lang.Object
-
- omero.rtypes
-
public abstract class rtypes extends java.lang.ObjectAbstract class similar toArraysorCollectionswhich 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 interfacertypes.ConversionSPI-style interface which helps the omero server to properly convert omero.RType objects into Java-native objects for use in Hibernate.static classrtypes.RTypeObjectFactoryRegistry
-
Constructor Summary
Constructors Constructor Description rtypes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RArrayrarray(java.util.Collection<RType> val)static RArrayrarray(RType... val)static RBoolrbool(boolean val)static RClassrclass(java.lang.String val)static RDoublerdouble(double val)static RFloatrfloat(float val)static RIntrint(int val)static RInternalrinternal(Internal val)static RListrlist(java.util.Collection<RType> val)static RListrlist(RType... val)static RLongrlong(long val)static RMaprmap()static RMaprmap(java.lang.String key, RType val)static RMaprmap(java.util.Map<java.lang.String,RType> val)static RObjectrobject(IObject val)static RSetrset(java.util.Collection<RType> val)static RSetrset(RType... val)static RStringrstring(java.lang.String val)static RTimertime(long val)static RTimertime(java.util.Date date)static RTimertime_max()static RTimertime_min()static RTimertime_str(java.lang.String tstr)static RTypertype(java.lang.Object obj)Attempts to dispatch to the other omero.rtypes.* static methods to create a properRTypesubclass by checking the type of the input.static java.lang.Objectunwrap(RType value)Descends into data structures unwrapping all RType objects as it goes.static java.lang.Objectunwrap(RType value, java.util.Map<RType,java.lang.Object> cache)Descends into data structures wrapping all elements as it goes.protected static voidunwrapCollection(java.util.Collection<RType> rtypes, java.util.Collection<java.lang.Object> rv, java.util.Map<RType,java.lang.Object> cache)static RTypewrap(java.lang.Object value)Descends into data structures wrapping all elements as it goes.static RTypewrap(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 properRTypesubclass by checking the type of the input. If null is given, null is returned. Otherwise, where possible anRTypeis returned, elseClientErroris 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 intoListinstances! 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 intoListinstances! 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()
-
-