org.apache.ignite.internal.processors.cache

## Class CacheObjectImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.CacheObjectAdapter
  - - org.apache.ignite.internal.processors.cache.CacheObjectImpl

All Implemented Interfaces:
  Externalizable, Serializable, CacheObject, Message

    public class CacheObjectImpl
    extends CacheObjectAdapter

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.CacheObjectAdapter

`val, valBytes`

### Fields inherited from interface org.apache.ignite.internal.processors.cache.CacheObject

`TYPE_BINARY, TYPE_BYTE_ARR, TYPE_REGULAR`

### Constructor Summary

Constructors
Constructor and Description
`CacheObjectImpl()`
`CacheObjectImpl(Object val, byte[] valBytes)`

### Method Summary

Methods
`byte` `directType()` Gets message type.
`boolean` `equals(Object obj)`
`void` `finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr)`
`int` `hashCode()`
`boolean` `isPlatformType()` Gets flag indicating whether object value is a platform type.
`CacheObject` `prepareForCache(CacheObjectContext ctx)` Prepares cache object for cache (e.g. copies user-provided object if needed).
`void` `prepareMarshal(CacheObjectContext ctx)`
`<T> T` `value(CacheObjectContext ctx, boolean cpy)`
`byte[]` `valueBytes(CacheObjectContext ctx)`

### Methods inherited from class org.apache.ignite.internal.processors.cache.CacheObjectAdapter

`cacheObjectType, fieldsCount, needCopy, readExternal, readFrom, toString, writeExternal, writeTo`

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

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

### Constructor Detail

#### CacheObjectImpl

    public CacheObjectImpl()

#### CacheObjectImpl

    public CacheObjectImpl(Object val,
                   byte[] valBytes)

Parameters:
  `val` - Value.
  `valBytes` - Value bytes.

### Method Detail

#### isPlatformType

    public boolean isPlatformType()

Gets flag indicating whether object value is a platform type. Platform types will be automatically deserialized on public API cache operations regardless whether `IgniteCache.withKeepBinary()` is used or not.

Returns:
  Platform type flag.

#### value

    @Nullable
    public <T> T value(CacheObjectContext ctx,
                       boolean cpy)

Parameters:
  `ctx` - Context.
  `cpy` - If `true` need to copy value.
Returns:
  Value.

#### valueBytes

    public byte[] valueBytes(CacheObjectContext ctx)
                      throws IgniteCheckedException

Parameters:
  `ctx` - Context.
Returns:
  Value bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### prepareMarshal

    public void prepareMarshal(CacheObjectContext ctx)
                        throws IgniteCheckedException

Parameters:
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### finishUnmarshal

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

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

#### directType

    public byte directType()

Gets message type.

Returns:
  Message type.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### prepareForCache

    public CacheObject prepareForCache(CacheObjectContext ctx)

Prepares cache object for cache (e.g. copies user-provided object if needed).

Parameters:
  `ctx` - Cache context.
Returns:
  Instance to store in cache.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015