org.apache.ignite.internal.processors.cache.version

## Class GridCacheVersionConflictContext<K,V>

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

    public class GridCacheVersionConflictContext<K,V>
    extends Object

Conflict context implementation.

### Constructor Summary

Constructors
Constructor and Description
`GridCacheVersionConflictContext(CacheObjectValueContext ctx, GridCacheVersionedEntry<K,V> oldEntry, GridCacheVersionedEntry<K,V> newEntry)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `expireTime()`
`boolean` `isManualResolve()`
`boolean` `isMerge()`
`boolean` `isUseNew()`
`boolean` `isUseOld()`
`void` `manualResolve()` Set manual resolve class.
`void` `merge(V mergeVal, long ttl)` Force cache to use neither old, nor new, but some other value passed as argument.
`V` `mergeValue()`
`GridCacheVersionedEntry<K,V>` `newEntry()` Gets new cache entry.
`GridCacheVersionedEntry<K,V>` `oldEntry()` Gets old (existing) cache entry.
`String` `toString()`
`long` `ttl()`
`void` `useNew()` Force cache to apply new entry overwriting old (existing) entry.
`void` `useOld()` Force cache to ignore new entry and leave old (existing) entry unchanged.
`CacheObjectValueContext` `valueContext()` Gets cache object context.

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

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

### Constructor Detail

#### GridCacheVersionConflictContext

    public GridCacheVersionConflictContext(CacheObjectValueContext ctx,
                                           GridCacheVersionedEntry<K,V> oldEntry,
                                           GridCacheVersionedEntry<K,V> newEntry)

Constructor.

Parameters:
  `oldEntry` - Old entry.
  `newEntry` - New entry.

### Method Detail

#### oldEntry

    public GridCacheVersionedEntry<K,V> oldEntry()

Gets old (existing) cache entry.

Returns:
  Old (existing) cache entry.

#### newEntry

    public GridCacheVersionedEntry<K,V> newEntry()

Gets new cache entry.

Returns:
  New cache entry.

#### valueContext

    public CacheObjectValueContext valueContext()

Gets cache object context.

Returns:
  Cache object context.

#### useOld

    public void useOld()

Force cache to ignore new entry and leave old (existing) entry unchanged.

#### useNew

    public void useNew()

Force cache to apply new entry overwriting old (existing) entry.

#### merge

    public void merge(@Nullable
                      V mergeVal,
                      long ttl)

Force cache to use neither old, nor new, but some other value passed as argument. In this case old value will be replaced with merge value and update will be considered as local.

Also in case of merge you have to specify new TTL explicitly. For unlimited TTL use `0`.

Parameters:
  `mergeVal` - Merge value or `null` to force remove.
  `ttl` - Time to live in milliseconds (must be non-negative).

#### isUseOld

    public boolean isUseOld()

Returns:
  `True` in case old value should be used.

#### isUseNew

    public boolean isUseNew()

Returns:
  `True` in case new value should be used.

#### isMerge

    public boolean isMerge()

Returns:
  `True` in case merge is to be performed.

#### manualResolve

    public void manualResolve()

Set manual resolve class.

#### isManualResolve

    public boolean isManualResolve()

Returns:
  Manual resolve flag.

#### mergeValue

    @Nullable
    public V mergeValue()

Returns:
  Value to merge (if any).

#### ttl

    public long ttl()

Returns:
  TTL.

#### expireTime

    public long expireTime()

Returns:
  Expire time.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021