org.apache.ignite.internal.processors.cache

## Interface CacheObject

All Superinterfaces:
  Message, Serializable

All Known Subinterfaces:
  KeyCacheObject

All Known Implementing Classes:
  CacheObjectAdapter, CacheObjectByteArrayImpl, CacheObjectImpl, KeyCacheObjectImpl

    public interface CacheObject
    extends Message

### Field Summary

Fields
`static byte` `TYPE_BYTE_ARR`
`static byte` `TYPE_REGULAR`

### Method Summary

Methods
`void` `finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr)`
`CacheObject` `prepareForCache(CacheObjectContext ctx)` Prepares cache object for cache (e.g. copies user-provided object if needed).
`void` `prepareMarshal(CacheObjectContext ctx)`
`byte` `type()`
`<T> T` `value(CacheObjectContext ctx, boolean cpy)`
`byte[]` `valueBytes(CacheObjectContext ctx)`

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

`directType, fieldsCount, readFrom, writeTo`

### Field Detail

#### TYPE_REGULAR

    static final byte TYPE_REGULAR

See Also:
  Constant Field Values

#### TYPE_BYTE_ARR

    static final byte TYPE_BYTE_ARR

See Also:
  Constant Field Values

### Method Detail

#### value

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

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

#### valueBytes

    byte[] valueBytes(CacheObjectContext ctx)
                      throws IgniteCheckedException

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

#### type

    byte type()

Returns:
  Object type.

#### prepareForCache

    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.

#### finishUnmarshal

    void finishUnmarshal(CacheObjectContext ctx,
                       ClassLoader ldr)
                         throws IgniteCheckedException

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

#### prepareMarshal

    void prepareMarshal(CacheObjectContext ctx)
                        throws IgniteCheckedException

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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015