org.apache.ignite.internal.processors.cacheobject

## Class UserCacheObjectImpl

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

All Implemented Interfaces:
  Externalizable, Serializable, CacheObject, Message

    public class UserCacheObjectImpl
    extends CacheObjectImpl

Wraps value provided by user, must be serialized before stored in cache.

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_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULAR`

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

`DIRECT_TYPE_SIZE`

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete Methods
`CacheObject` `prepareForCache(CacheObjectContext ctx)` Prepares cache object for cache (e.g. copies user-provided object if needed).
`<T> T` `value(CacheObjectValueContext ctx, boolean cpy)`

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

`directType, equals, finishUnmarshal, hashCode, isPlatformType, onAckReceived, prepareMarshal, valueBytes`

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

`cacheObjectType, fieldsCount, needCopy, objectPutSize, putValue, putValue, putValue, putValue, putValue, readExternal, readFrom, toString, valueBytesLength, writeExternal, writeTo`

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

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

### Constructor Detail

#### UserCacheObjectImpl

    public UserCacheObjectImpl()

#### UserCacheObjectImpl

    public UserCacheObjectImpl(Object val,
                               byte[] valBytes)

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

### Method Detail

#### value

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

Specified by:
  `value` in interface `CacheObject`
Overrides:
  `value` in class `CacheObjectImpl`
Parameters:
  `ctx` - Context.
  `cpy` - If `true` need to copy value.
Returns:
  Value.

#### prepareForCache

    public CacheObject prepareForCache(CacheObjectContext ctx)

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

Specified by:
  `prepareForCache` in interface `CacheObject`
Overrides:
  `prepareForCache` in class `CacheObjectImpl`
Parameters:
  `ctx` - Cache context.
Returns:
  Instance to store in cache.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018