org.apache.ignite.spi.swapspace

## Class SwapKey

- java.lang.Object
- - org.apache.ignite.spi.swapspace.SwapKey

    public class SwapKey
    extends Object

Utility wrapper class that represents swap key.

This class also holds information about partition this key belongs to (if needed for caches).

### Constructor Summary

Constructors
Constructor and Description
`SwapKey(KeyCacheObject key, int part, byte[] keyBytes)`
`SwapKey(Object key)`
`SwapKey(Object key, int part)`

### Method Summary

Methods
`boolean` `equals(Object obj)`
`int` `hashCode()`
`Object` `key()`
`byte[]` `keyBytes()`
`void` `keyBytes(byte[] keyBytes)`
`int` `partition()`
`String` `toString()`

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

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

### Constructor Detail

#### SwapKey

    public SwapKey(Object key)

Parameters:
  `key` - Key.

#### SwapKey

    public SwapKey(Object key,
           int part)

Parameters:
  `key` - Key.
  `part` - Partition.

#### SwapKey

    public SwapKey(KeyCacheObject key,
           int part,
           @Nullable
           byte[] keyBytes)

Parameters:
  `key` - Key.
  `part` - Part.
  `keyBytes` - Key bytes.

### Method Detail

#### key

    public Object key()

Returns:
  Key.

#### partition

    public int partition()

Returns:
  Partition this key belongs to.

#### keyBytes

    @Nullable
    public byte[] keyBytes()

Returns:
  Serialized key.

#### keyBytes

    public void keyBytes(byte[] keyBytes)

Parameters:
  `keyBytes` - Serialized key.

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015