org.apache.ignite.internal.processors.cache

## Class GridCacheReturn<V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheReturn<V>

All Implemented Interfaces:
  Externalizable, Serializable, OptimizedMarshallable

    public class GridCacheReturn<V>
    extends Object
    implements Externalizable, OptimizedMarshallable

Return value for cases where both, value and success flag need to be returned.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface org.apache.ignite.marshaller.optimized.OptimizedMarshallable

`CLS_ID_FIELD_NAME`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheReturn()` Empty constructor.
`GridCacheReturn(boolean success)`
`GridCacheReturn(V v, boolean success)`
`GridCacheReturn(V v, boolean success, boolean invokeRes)`

### Method Summary

Methods
`void` `addEntryProcessResult(Object key, javax.cache.processor.EntryProcessorResult<?> res)`
`Object` `ggClassId()` Implementation of this method should simply return value of `GG_CLASS_ID` field.
`boolean` `hasValue()` Checks if value is not `null`.
`boolean` `invokeResult()`
`void` `invokeResult(boolean invokeRes)`
`void` `mergeEntryProcessResults(GridCacheReturn<V> other)`
`void` `readExternal(ObjectInput in)`
`GridCacheReturn<V>` `set(V v, boolean success)`
`boolean` `success()`
`GridCacheReturn<V>` `success(boolean success)`
`String` `toString()`
`V` `value()`
`GridCacheReturn<V>` `value(V v)`
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridCacheReturn

    public GridCacheReturn()

Empty constructor.

#### GridCacheReturn

    public GridCacheReturn(boolean success)

Parameters:
  `success` - Success flag.

#### GridCacheReturn

    public GridCacheReturn(V v,
                   boolean success)

Parameters:
  `v` - Value.
  `success` - Success flag.

#### GridCacheReturn

    public GridCacheReturn(V v,
                   boolean success,
                   boolean invokeRes)

Parameters:
  `v` - Value.
  `success` - Success flag.

### Method Detail

#### value

    @Nullable
    public V value()

Returns:
  Value.

#### hasValue

    public boolean hasValue()

Checks if value is not `null`.

Returns:
  `True` if value is not `null`.

#### invokeResult

    public boolean invokeResult()

Returns:
  If return is invoke result.

#### invokeResult

    public void invokeResult(boolean invokeRes)

Parameters:
  `invokeRes` - Invoke result flag.

#### value

    public GridCacheReturn<V> value(V v)

Parameters:
  `v` - Value.
Returns:
  This instance for chaining.

#### success

    public boolean success()

Returns:
  Success flag.

#### set

    public GridCacheReturn<V> set(@Nullable
                         V v,
                         boolean success)

Parameters:
  `v` - Value to set.
  `success` - Success flag to set.
Returns:
  This instance for chaining.

#### success

    public GridCacheReturn<V> success(boolean success)

Parameters:
  `success` - Success flag.
Returns:
  This instance for chaining.

#### addEntryProcessResult

    public void addEntryProcessResult(Object key,
                             javax.cache.processor.EntryProcessorResult<?> res)

Parameters:
  `key` - Key.
  `res` - Result.

#### mergeEntryProcessResults

    public void mergeEntryProcessResults(GridCacheReturn<V> other)

Parameters:
  `other` - Other result to merge with.

#### ggClassId

    public Object ggClassId()

Implementation of this method should simply return value of `GG_CLASS_ID` field.

Specified by:
  `ggClassId` in interface `OptimizedMarshallable`
Returns:
  Class ID for optimized marshalling.

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015