py4j

## Class ReturnObject

- java.lang.Object
- - py4j.ReturnObject

-     public class ReturnObject
      extends Object

  A ReturnObject wraps a value returned by a method. If the value is a primitive, a primitive wrapper object (e.g., Integer) or a String, the value is kept in the primitiveObject field.

  If the return value is an object, a key to the reference is kept in the name field. This value can be retrieved by calling `Gateway.getObject(String)` with the key.

  Various methods are defined to determine the type of the return value. For example, if the return value is void, the name and primitiveObject fields are null, but `isVoid()` returns true.

  ReturnObject objects can only be constructed through static factory methods such as `getListReturnObject(String, int)`.

  Author:
    barthelemy

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ReturnObject` | `getArrayReturnObject(String name, int size)`
    `String` | `getCommandPart()`
    `static ReturnObject` | `getDecimalReturnObject(Object object)`
    `static ReturnObject` | `getErrorReferenceReturnObject(String name)`
    `static ReturnObject` | `getErrorReturnObject()`
    `static ReturnObject` | `getErrorReturnObject(Throwable throwable)`
    `static ReturnObject` | `getIteratorReturnObject(String name)`
    `static ReturnObject` | `getListReturnObject(String name, int size)`
    `static ReturnObject` | `getMapReturnObject(String name, int size)`
    `String` | `getName()`
    `static ReturnObject` | `getNullReturnObject()`
    `Object` | `getPrimitiveObject()`
    `static ReturnObject` | `getPrimitiveReturnObject(Object primitive)`
    `static ReturnObject` | `getReferenceReturnObject(String name)`
    `static ReturnObject` | `getSetReturnObject(String name, int size)`
    `int` | `getSize()`
    `static ReturnObject` | `getVoidReturnObject()`
    `boolean` | `isArray()`
    `boolean` | `isDecimal()`
    `boolean` | `isError()`
    `boolean` | `isIterator()`
    `boolean` | `isList()`
    `boolean` | `isMap()`
    `boolean` | `isNull()`
    `boolean` | `isReference()`
    `boolean` | `isSet()`
    `boolean` | `isVoid()`
    `void` | `setArray(boolean isArray)`
    `void` | `setCommandPart(String commandPart)`
    `void` | `setError(boolean isError)`
    `void` | `setIterator(boolean isIterator)`
    `void` | `setList(boolean isList)`
    `void` | `setMap(boolean isMap)`
    `void` | `setName(String name)`
    `void` | `setNull(boolean isNull)`
    `void` | `setPrimitiveObject(Object primitiveObject)`
    `void` | `setReference(boolean isReference)`
    `void` | `setSet(boolean isSet)`
    `void` | `setSize(int size)`
    `void` | `setVoid(boolean isVoid)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getArrayReturnObject

          public static ReturnObject getArrayReturnObject(String name,
                                                          int size)

    - #### getDecimalReturnObject

          public static ReturnObject getDecimalReturnObject(Object object)

    - #### getErrorReferenceReturnObject

          public static ReturnObject getErrorReferenceReturnObject(String name)

    - #### getErrorReturnObject

          public static ReturnObject getErrorReturnObject()

    - #### getErrorReturnObject

          public static ReturnObject getErrorReturnObject(Throwable throwable)

    - #### getIteratorReturnObject

          public static ReturnObject getIteratorReturnObject(String name)

    - #### getListReturnObject

          public static ReturnObject getListReturnObject(String name,
                                                         int size)

    - #### getMapReturnObject

          public static ReturnObject getMapReturnObject(String name,
                                                        int size)

    - #### getNullReturnObject

          public static ReturnObject getNullReturnObject()

    - #### getPrimitiveReturnObject

          public static ReturnObject getPrimitiveReturnObject(Object primitive)

    - #### getReferenceReturnObject

          public static ReturnObject getReferenceReturnObject(String name)

    - #### getSetReturnObject

          public static ReturnObject getSetReturnObject(String name,
                                                        int size)

    - #### getVoidReturnObject

          public static ReturnObject getVoidReturnObject()

    - #### getCommandPart

          public String getCommandPart()

    - #### getName

          public String getName()

    - #### getPrimitiveObject

          public Object getPrimitiveObject()

    - #### getSize

          public int getSize()

    - #### isArray

          public boolean isArray()

    - #### isDecimal

          public boolean isDecimal()

    - #### isError

          public boolean isError()

    - #### isIterator

          public boolean isIterator()

    - #### isList

          public boolean isList()

    - #### isMap

          public boolean isMap()

    - #### isNull

          public boolean isNull()

    - #### isReference

          public boolean isReference()

    - #### isSet

          public boolean isSet()

    - #### isVoid

          public boolean isVoid()

    - #### setArray

          public void setArray(boolean isArray)

    - #### setCommandPart

          public void setCommandPart(String commandPart)

    - #### setError

          public void setError(boolean isError)

    - #### setIterator

          public void setIterator(boolean isIterator)

    - #### setList

          public void setList(boolean isList)

    - #### setMap

          public void setMap(boolean isMap)

    - #### setName

          public void setName(String name)

    - #### setNull

          public void setNull(boolean isNull)

    - #### setPrimitiveObject

          public void setPrimitiveObject(Object primitiveObject)

    - #### setReference

          public void setReference(boolean isReference)

    - #### setSet

          public void setSet(boolean isSet)

    - #### setSize

          public void setSize(int size)

    - #### setVoid

          public void setVoid(boolean isVoid)