org.apache.ignite.internal.processors.cache

## Class CacheLazyEntry<K,V>

- java.lang.Object
- - org.apache.ignite.cache.CacheInterceptorEntry<K,V>
  - - org.apache.ignite.internal.processors.cache.CacheLazyEntry<K,V>

All Implemented Interfaces:
  javax.cache.Cache.Entry<K,V>

Direct Known Subclasses:
  CacheInvokeEntry

    public class CacheLazyEntry<K,V>
    extends CacheInterceptorEntry<K,V>

### Field Summary

Fields
`protected GridCacheContext` `cctx` Cache context.
`protected K` `key` Key.
`protected KeyCacheObject` `keyObj` Key cache object.
`protected V` `val` Value.
`protected CacheObject` `valObj` Cache object value.

### Constructor Summary

Constructors
Constructor and Description
`CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary)`
`CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary)`
`CacheLazyEntry(GridCacheContext ctx, KeyCacheObject keyObj, K key, CacheObject valObj, V val, boolean keepBinary, Long updateCntr)`
`CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary)`

### Method Summary

All Methods Instance Methods Concrete Methods
`K` `getKey()`
`long` `getPartitionUpdateCounter()` Each cache update increases partition counter.
`V` `getValue()`
`V` `getValue(boolean keepBinary)` Returns the value stored in the cache when this entry was created.
`boolean` `keepBinary()`
`K` `key()`
`String` `toString()`
`<T> T` `unwrap(Class<T> cls)`
`void` `updateCounter(long updateCntr)` Sets update counter.
`V` `value()`

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

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

### Field Detail

#### cctx

    protected GridCacheContext cctx

Cache context.

#### keyObj

    protected KeyCacheObject keyObj

Key cache object.

#### valObj

    protected CacheObject valObj

Cache object value.

#### key

    @GridToStringInclude(sensitive=true)
    protected K key

Key.

#### val

    @GridToStringInclude(sensitive=true)
    protected V val

Value.

### Constructor Detail

#### CacheLazyEntry

    public CacheLazyEntry(GridCacheContext cctx,
                          KeyCacheObject keyObj,
                          CacheObject valObj,
                          boolean keepBinary)

Parameters:
  `cctx` - Cache context.
  `keyObj` - Key cache object.
  `valObj` - Cache object value.
  `keepBinary` - Keep binary flag.

#### CacheLazyEntry

    public CacheLazyEntry(GridCacheContext cctx,
                          KeyCacheObject keyObj,
                          V val,
                          boolean keepBinary)

Parameters:
  `keyObj` - Key cache object.
  `val` - Value.
  `keepBinary` - Keep binary flag.
  `cctx` - Cache context.

#### CacheLazyEntry

    public CacheLazyEntry(GridCacheContext ctx,
                          KeyCacheObject keyObj,
                          K key,
                          CacheObject valObj,
                          V val,
                          boolean keepBinary,
                          Long updateCntr)

Parameters:
  `ctx` - Cache context.
  `keyObj` - Key cache object.
  `key` - Key value.
  `valObj` - Cache object
  `keepBinary` - Keep binary flag.
  `updateCntr` - Partition update counter.
  `val` - Cache value.

#### CacheLazyEntry

    public CacheLazyEntry(GridCacheContext ctx,
                          KeyCacheObject keyObj,
                          K key,
                          CacheObject valObj,
                          V val,
                          boolean keepBinary)

Parameters:
  `ctx` - Cache context.
  `keyObj` - Key cache object.
  `key` - Key value.
  `valObj` - Cache object
  `keepBinary` - Keep binary flag.
  `val` - Cache value.

### Method Detail

#### getKey

    public K getKey()

#### getValue

    public V getValue()

#### getValue

    public V getValue(boolean keepBinary)

Returns the value stored in the cache when this entry was created.

Parameters:
  `keepBinary` - Flag to keep binary if needed.
Returns:
  the value corresponding to this entry

#### value

    public V value()

Returns:
  Return value. This methods doesn't initialize value.

#### key

    public K key()

Returns:
  Return key. This methods doesn't initialize key.

#### keepBinary

    public boolean keepBinary()

Returns:
  Keep binary flag.

#### getPartitionUpdateCounter

    public long getPartitionUpdateCounter()

Each cache update increases partition counter. The same cache updates have on the same value of counter on primary and backup nodes. This value can be useful to communicate with external applications. The value has sense only for entries get by `CacheInterceptor.onAfterPut(Cache.Entry)` and `CacheInterceptor.onAfterRemove(Cache.Entry)` methods. For entries got by other methods will return `0`.

Specified by:
  `getPartitionUpdateCounter` in class `CacheInterceptorEntry<K,V>`
Returns:
  Value of counter for this entry.

#### updateCounter

    public void updateCounter(long updateCntr)

Sets update counter.

Parameters:
  `updateCntr` - Update counter.

#### unwrap

    public <T> T unwrap(Class<T> cls)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018