org.apache.ignite.internal.processors.cache.distributed.near

## Class CacheVersionedValue

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.distributed.near.CacheVersionedValue

All Implemented Interfaces:
  Serializable, Message

    public class CacheVersionedValue
    extends Object
    implements Message

Cache object and version.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`CacheVersionedValue()`
`CacheVersionedValue(CacheObject val, GridCacheVersion ver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`void` `finishUnmarshal(GridCacheContext ctx, ClassLoader ldr)` This method is called after the whole message is received and is responsible for unmarshalling state.
`void` `onAckReceived()` Method called when ack message received.
`void` `prepareMarshal(CacheObjectContext ctx)` This method is called before the whole message is sent and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`String` `toString()`
`CacheObject` `value()`
`GridCacheVersion` `version()`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Constructor Detail

#### CacheVersionedValue

    public CacheVersionedValue()

#### CacheVersionedValue

    public CacheVersionedValue(CacheObject val,
                               GridCacheVersion ver)

Parameters:
  `val` - Cache value.
  `ver` - Cache version.

### Method Detail

#### version

    public GridCacheVersion version()

Returns:
  Cache version.

#### value

    public CacheObject value()

Returns:
  Cache object.

#### prepareMarshal

    public void prepareMarshal(CacheObjectContext ctx)
                        throws IgniteCheckedException

This method is called before the whole message is sent and is responsible for pre-marshalling state.

Parameters:
  `ctx` - Cache object context.
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

    public void finishUnmarshal(GridCacheContext ctx,
                                ClassLoader ldr)
                         throws IgniteCheckedException

This method is called after the whole message is received and is responsible for unmarshalling state.

Parameters:
  `ctx` - Context.
  `ldr` - Class loader.
Throws:
  `IgniteCheckedException` - If failed.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

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

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public short directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020