Package omero

Class rtypes


  • public abstract class rtypes
    extends java.lang.Object
    Abstract class similar to 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.
    • 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()  
    • Constructor Detail

      • rtypes

        public rtypes()
    • Method Detail

      • rtype

        public 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. If null is given, null is returned. Otherwise, where possible an RType is returned, else ClientError 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! Calls wrap(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 wrap
        cache - 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 into List instances! Calls unwrap(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 into List instances! The cache argument is used to prevent cycles.
        Parameters:
        value - the wrapped value
        cache - 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)
      • rarray

        public static RArray rarray​(RType... val)
      • rarray

        public static RArray rarray​(java.util.Collection<RType> val)
      • rlist

        public static RList rlist​(RType... val)
      • rlist

        public static RList rlist​(java.util.Collection<RType> val)
      • rset

        public static RSet rset​(RType... val)
      • rset

        public static RSet rset​(java.util.Collection<RType> val)
      • rmap

        public static RMap rmap()
      • rmap

        public static RMap rmap​(java.util.Map<java.lang.String,​RType> val)
      • rmap

        public static RMap rmap​(java.lang.String key,
                                RType val)