org.apache.ignite.internal.processors.cache

## Class GridCacheValueBytes

- java.lang.Object
- - org.apache.ignite.plugin.extensions.communication.MessageAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheValueBytes

All Implemented Interfaces:
  Serializable

    public class GridCacheValueBytes
    extends MessageAdapter

Wrapped value bytes of cache entry.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`MessageAdapter.Type`

### Field Summary

### Fields inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`reader, readState`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheValueBytes()` Private constructor for NULL instance.
`GridCacheValueBytes(byte[] bytes, boolean plain)` Constructor.

### Method Summary

Methods
`byte` `directType()` Gets message type.
`byte[]` `get()`
`byte[]` `getIfMarshaled()`
`byte[]` `getIfPlain()`
`boolean` `isNull()`
`boolean` `isPlain()`
`static GridCacheValueBytes` `marshaled(byte[] bytes)`
`static GridCacheValueBytes` `nil()`
`static GridCacheValueBytes` `plain(Object bytes)`
`boolean` `readFrom(ByteBuffer buf)` Reads this message from provided byte buffer.
`String` `toString()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class org.apache.ignite.plugin.extensions.communication.MessageAdapter

`setReader, skipRecovery`

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

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

### Constructor Detail

#### GridCacheValueBytes

    public GridCacheValueBytes()

Private constructor for NULL instance.

#### GridCacheValueBytes

    public GridCacheValueBytes(byte[] bytes,
                       boolean plain)

Constructor.

Parameters:
  `bytes` - Bytes.
  `plain` - Flag indicating if provided byte array is actual value, not marshaled data.

### Method Detail

#### plain

    public static GridCacheValueBytes plain(Object bytes)

Parameters:
  `bytes` - Bytes.
Returns:
  Plain value bytes.

#### marshaled

    public static GridCacheValueBytes marshaled(byte[] bytes)

Parameters:
  `bytes` - Bytes.
Returns:
  Marshaled value bytes.

#### nil

    public static GridCacheValueBytes nil()

Returns:
  Nil value bytes.

#### get

    @Nullable
    public byte[] get()

Returns:
  Bytes.

#### getIfPlain

    @Nullable
    public byte[] getIfPlain()

Returns:
  Bytes if this is plain bytes or `null` otherwise.

#### getIfMarshaled

    @Nullable
    public byte[] getIfMarshaled()

Returns:
  Bytes if this is marshaled bytes or `null` otherwise.

#### isPlain

    public boolean isPlain()

Returns:
  Flag indicating if provided byte array is actual value, not marshaled data.

#### isNull

    public boolean isNull()

Returns:
  `True` if byte array is `null`.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in class `MessageAdapter`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in class `MessageAdapter`
Parameters:
  `buf` - Byte buffer.
Returns:
  Whether message was fully read.

#### directType

    public byte directType()

Gets message type.

Specified by:
  `directType` in class `MessageAdapter`
Returns:
  Message type.

#### 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