public class WriteRequest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WriteRequest.Type |
| Modifier and Type | Field and Description |
|---|---|
static int |
ANY_VERSION |
| Modifier | Constructor and Description |
|---|---|
protected |
WriteRequest(WriteRequest.Type type,
String tableName,
String key,
byte[] newValue,
long previousVersion,
byte[] oldValue) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
key() |
byte[] |
newValue() |
byte[] |
oldValue() |
long |
previousVersion() |
static WriteRequest |
put(String tableName,
String key,
byte[] newValue)
Creates a write request, which will
put the specified value to the table regardless of the previous value.
|
static WriteRequest |
putIfAbsent(String tableName,
String key,
byte[] newValue)
Creates a write request, which will
put the specified value to the table if the previous value does not exist.
|
static WriteRequest |
putIfValueMatches(String tableName,
String key,
byte[] oldValue,
byte[] newValue)
Creates a write request, which will
put the specified value to the table if the previous value matches.
|
static WriteRequest |
putIfVersionMatches(String tableName,
String key,
byte[] newValue,
long previousVersion)
Creates a write request, which will
put the specified value to the table if the previous version matches.
|
static WriteRequest |
remove(String tableName,
String key)
Creates a write request, which will
remove the specified entry from the table regardless of the previous value.
|
static WriteRequest |
removeIfValueMatches(String tableName,
String key,
byte[] oldValue)
Creates a write request, which will
remove the specified entry from the table if the previous value matches.
|
static WriteRequest |
removeIfVersionMatches(String tableName,
String key,
long previousVersion)
Creates a write request, which will
remove the specified entry from the table if the previous version matches.
|
String |
tableName() |
String |
toString() |
WriteRequest.Type |
type() |
public static final int ANY_VERSION
protected WriteRequest(WriteRequest.Type type, String tableName, String key, byte[] newValue, long previousVersion, byte[] oldValue)
public static WriteRequest put(String tableName, String key, byte[] newValue)
tableName - name of the tablekey - key in the tablenewValue - value to write, must not be nullpublic static WriteRequest putIfVersionMatches(String tableName, String key, byte[] newValue, long previousVersion)
tableName - name of the tablekey - key in the tablenewValue - value to write, must not be nullpreviousVersion - previous version expectedpublic static WriteRequest putIfValueMatches(String tableName, String key, byte[] oldValue, byte[] newValue)
tableName - name of the tablekey - key in the tableoldValue - previous value expected, must not be nullnewValue - value to write, must not be nullpublic static WriteRequest putIfAbsent(String tableName, String key, byte[] newValue)
tableName - name of the tablekey - key in the tablenewValue - value to write, must not be nullpublic static WriteRequest remove(String tableName, String key)
tableName - name of the tablekey - key in the tablepublic static WriteRequest removeIfVersionMatches(String tableName, String key, long previousVersion)
tableName - name of the tablekey - key in the tablepreviousVersion - previous version expectedpublic static WriteRequest removeIfValueMatches(String tableName, String key, byte[] oldValue)
tableName - name of the tablekey - key in the tableoldValue - previous value expected, must not be nullpublic String tableName()
public String key()
public WriteRequest.Type type()
public byte[] newValue()
public long previousVersion()
public byte[] oldValue()
Copyright © 2015. All rights reserved.