Class Any


  • public class Any
    extends java.lang.Object
    The UNO IDL type any is mapped to java type java.lang.Object.

    In special cases it is necessary to have an explicit any to additionally transport an exact type. For instance if you want to pass an object reference via an interprocess connection using an any, you should use this class to add an explicit interface type, so the remote counterpart doesn't need to invoke a queryInterface).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object _object
      The data of the any.
      protected Type _type
      The type of the any.
      static Any VOID  
    • Constructor Summary

      Constructors 
      Constructor Description
      Any​(Type type, java.lang.Object object)
      Constructs a new any with a given type and value
      Any​(java.lang.Class<?> zInterface, java.lang.Object object)
      Deprecated.
      as of UDK 2.0
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Any complete​(java.lang.Object any)
      Complete a UNO ANY (make sure it is wrapped up as an Any instance).
      boolean equals​(java.lang.Object obj)
      Indicates whether some other object is equal to this one.
      java.lang.Object getObject()
      Gets the value within the any.
      Type getType()
      Gets the type of the value within the any.
      int hashCode()
      Returns a hash code value for the object.
      java.lang.String toString()
      Returns a string representation of the object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _type

        protected Type _type
        The type of the any.
        See Also:
        getType()
      • _object

        protected java.lang.Object _object
        The data of the any.
        See Also:
        getObject()
      • VOID

        public static final Any VOID
    • Constructor Detail

      • Any

        @Deprecated
        public Any​(java.lang.Class<?> zInterface,
                   java.lang.Object object)
        Deprecated.
        as of UDK 2.0
        Constructs a new any.
        Parameters:
        zInterface - the type of the any.
        object - the data of the any.
      • Any

        public Any​(Type type,
                   java.lang.Object object)
        Constructs a new any with a given type and value
        Parameters:
        type - the UNO type of the any.
        object - the value of the any.
    • Method Detail

      • complete

        public static final Any complete​(java.lang.Object any)
        Complete a UNO ANY (make sure it is wrapped up as an Any instance).
        Parameters:
        any - a Java value representing a UNO ANY value.
        Returns:
        a complete Java value (that is, an Any instance) representing the same UNO ANY value as the given argument.
        Since:
        UDK 3.2.3
      • getType

        public Type getType()
        Gets the type of the value within the any.
        Returns:
        the type of the value within the any.
      • getObject

        public java.lang.Object getObject()
        Gets the value within the any.
        Returns:
        gets the value within the any.
      • equals

        public boolean equals​(java.lang.Object obj)
        Indicates whether some other object is equal to this one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Returns a hash code value for the object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code value for this object.
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Returns a string representation of the object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the object.
        See Also:
        Object.toString()