org.apache.ignite.internal.processors.cache

## Class GridCacheSwapEntryImpl<V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSwapEntryImpl<V>

All Implemented Interfaces:
  GridCacheSwapEntry<V>

Direct Known Subclasses:
  GridCacheBatchSwapEntry

    public class GridCacheSwapEntryImpl<V>
    extends Object
    implements GridCacheSwapEntry<V>

Swap entry.

### Constructor Summary

Constructors
Constructor and Description
`GridCacheSwapEntryImpl(ByteBuffer valBytes, boolean valIsByteArr, GridCacheVersion ver, long ttl, long expireTime, IgniteUuid keyClsLdrId, IgniteUuid valClsLdrId)`

### Method Summary

Methods
`long` `expireTime()`
`static long` `expireTime(byte[] bytes)`
`static byte[]` `getValueIfByteArray(byte[] bytes)`
`IgniteUuid` `keyClassLoaderId()`
`byte[]` `marshal()`
`long` `offheapPointer()`
`static long` `timeToLive(byte[] bytes)`
`String` `toString()`
`long` `ttl()`
`static <T> GridCacheSwapEntryImpl<T>` `unmarshal(byte[] arr)`
`V` `value()`
`void` `value(V val)`
`byte[]` `valueBytes()`
`void` `valueBytes(byte[] valBytes)`
`IgniteUuid` `valueClassLoaderId()`
`boolean` `valueIsByteArray()`
`static int` `valueOffset(byte[] bytes)`
`GridCacheVersion` `version()`
`static GridCacheVersion` `version(byte[] bytes)`

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

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

### Constructor Detail

#### GridCacheSwapEntryImpl

    public GridCacheSwapEntryImpl(ByteBuffer valBytes,
                          boolean valIsByteArr,
                          GridCacheVersion ver,
                          long ttl,
                          long expireTime,
                          @Nullable
                          IgniteUuid keyClsLdrId,
                          @Nullable
                          IgniteUuid valClsLdrId)

Parameters:
  `valBytes` - Value.
  `valIsByteArr` - Whether value of this entry is byte array.
  `ver` - Version.
  `ttl` - Entry time to live.
  `expireTime` - Expire time.
  `keyClsLdrId` - Class loader ID for entry key (can be `null` for local class loader).
  `valClsLdrId` - Class loader ID for entry value (can be `null` for local class loader).

### Method Detail

#### timeToLive

    public static long timeToLive(byte[] bytes)

Parameters:
  `bytes` - Entry bytes.
Returns:
  TTL.

#### expireTime

    public static long expireTime(byte[] bytes)

Parameters:
  `bytes` - Entry bytes.
Returns:
  Expire time.

#### version

    public static GridCacheVersion version(byte[] bytes)

Parameters:
  `bytes` - Entry bytes.
Returns:
  Version.

#### getValueIfByteArray

    @Nullable
    public static byte[] getValueIfByteArray(byte[] bytes)

Parameters:
  `bytes` - Entry bytes.
Returns:
  Value if value is byte array, otherwise `null`.

#### valueOffset

    public static int valueOffset(byte[] bytes)

Parameters:
  `bytes` - Entry bytes.
Returns:
  Value bytes offset.

#### valueBytes

    public byte[] valueBytes()

Specified by:
  `valueBytes` in interface `GridCacheSwapEntry<V>`
Returns:
  Value bytes.

#### valueBytes

    public void valueBytes(@Nullable
                  byte[] valBytes)

Specified by:
  `valueBytes` in interface `GridCacheSwapEntry<V>`
Parameters:
  `valBytes` - Value bytes.

#### value

    public V value()

Specified by:
  `value` in interface `GridCacheSwapEntry<V>`
Returns:
  Value.

#### value

    public void value(V val)

Specified by:
  `value` in interface `GridCacheSwapEntry<V>`
Parameters:
  `val` - Value.

#### valueIsByteArray

    public boolean valueIsByteArray()

Specified by:
  `valueIsByteArray` in interface `GridCacheSwapEntry<V>`
Returns:
  Whether value is byte array.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheSwapEntry<V>`
Returns:
  Version.

#### ttl

    public long ttl()

Specified by:
  `ttl` in interface `GridCacheSwapEntry<V>`
Returns:
  Time to live.

#### expireTime

    public long expireTime()

Specified by:
  `expireTime` in interface `GridCacheSwapEntry<V>`
Returns:
  Expire time.

#### keyClassLoaderId

    @Nullable
    public IgniteUuid keyClassLoaderId()

Specified by:
  `keyClassLoaderId` in interface `GridCacheSwapEntry<V>`
Returns:
  Class loader ID for entry key (`null` for local class loader).

#### valueClassLoaderId

    @Nullable
    public IgniteUuid valueClassLoaderId()

Specified by:
  `valueClassLoaderId` in interface `GridCacheSwapEntry<V>`
Returns:
  Class loader ID for entry value (`null` for local class loader).

#### offheapPointer

    public long offheapPointer()

Specified by:
  `offheapPointer` in interface `GridCacheSwapEntry<V>`
Returns:
  If entry is offheap based returns offheap address, otherwise 0.

#### marshal

    public byte[] marshal()

Returns:
  Entry bytes.

#### unmarshal

    public static <T> GridCacheSwapEntryImpl<T> unmarshal(byte[] arr)

Parameters:
  `arr` - Entry bytes.
Returns:
  Entry.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015