public class TableWriteItems
extends java.lang.Object
BatchWriteItem
request.Modifier and Type | Field and Description |
---|---|
private java.util.Collection<Item> |
itemsToPut |
private java.util.List<PrimaryKey> |
primaryKeysToDelete |
private java.lang.String |
tableName |
Constructor and Description |
---|
TableWriteItems(java.lang.String tableName) |
Modifier and Type | Method and Description |
---|---|
TableWriteItems |
addHashAndRangePrimaryKeysToDelete(java.lang.String hashKeyName,
java.lang.String rangeKeyName,
java.lang.Object... alternatingHashRangeKeyValues)
Adds multiple hash-and-range primary keys to be deleted in a batch
write operation.
|
TableWriteItems |
addHashAndRangePrimaryKeyToDelete(java.lang.String hashKeyName,
java.lang.Object hashKeyValue,
java.lang.String rangeKeyName,
java.lang.Object rangeKeyValue)
Adds a primary key (that consists of a hash-key and a range-key) to be
deleted in a batch write operation.
|
TableWriteItems |
addHashOnlyPrimaryKeysToDelete(java.lang.String hashKeyName,
java.lang.Object... hashKeyValues)
Adds multiple hash-only primary keys to be deleted in a batch write
operation.
|
TableWriteItems |
addHashOnlyPrimaryKeyToDelete(java.lang.String hashKeyName,
java.lang.Object hashKeyValue)
Adds a hash-only primary key to be deleted in a batch write
operation.
|
TableWriteItems |
addItemToPut(Item item)
Adds an item to be put to the current table in a batch write operation.
|
TableWriteItems |
addPrimaryKeyToDelete(PrimaryKey primaryKey)
Adds a primary key to be deleted in a batch write-item operation.
|
private void |
checkConsistency(PrimaryKey primaryKey) |
java.util.Collection<Item> |
getItemsToPut()
Returns the collection of items to be put in the current table in
a batch write operation.
|
java.util.List<PrimaryKey> |
getPrimaryKeysToDelete()
Return the list of primary keys (of the current table) to be deleted in
a batch write operation.
|
java.lang.String |
getTableName() |
TableWriteItems |
withHashAndRangeKeysToDelete(java.lang.String hashKeyName,
java.lang.String rangeKeyName,
java.lang.Object... alternatingHashAndRangeKeyValues)
Used to specify multiple hash-and-range primary keys to be deleted
from the current table.
|
TableWriteItems |
withHashOnlyKeysToDelete(java.lang.String hashKeyName,
java.lang.Object... hashKeyValues)
Used to specify multiple hash-only primary keys to be deleted from the
current table.
|
TableWriteItems |
withItemsToPut(java.util.Collection<Item> itemsToPut)
Used to specify the collection of items to be put in the current table in
a batch write operation.
|
TableWriteItems |
withItemsToPut(Item... itemsToPut)
Used to specify the items to be put in the current table in a batch write
operation.
|
TableWriteItems |
withPrimaryKeysToDelete(PrimaryKey... primaryKeysToDelete)
Used to specify multiple primary keys to be deleted from the current
table.
|
private final java.lang.String tableName
private java.util.List<PrimaryKey> primaryKeysToDelete
private java.util.Collection<Item> itemsToPut
public java.util.List<PrimaryKey> getPrimaryKeysToDelete()
public TableWriteItems withPrimaryKeysToDelete(PrimaryKey... primaryKeysToDelete)
public TableWriteItems withHashOnlyKeysToDelete(java.lang.String hashKeyName, java.lang.Object... hashKeyValues)
hashKeyName
- hash-only key namehashKeyValues
- a list of hash key valuespublic TableWriteItems withHashAndRangeKeysToDelete(java.lang.String hashKeyName, java.lang.String rangeKeyName, java.lang.Object... alternatingHashAndRangeKeyValues)
hashKeyName
- hash key namerangeKeyName
- range key namealternatingHashAndRangeKeyValues
- a list of alternating hash key value and range key valuepublic TableWriteItems addPrimaryKeyToDelete(PrimaryKey primaryKey)
private void checkConsistency(PrimaryKey primaryKey)
public TableWriteItems addHashOnlyPrimaryKeyToDelete(java.lang.String hashKeyName, java.lang.Object hashKeyValue)
hashKeyName
- name of the hash key attribute namehashKeyValue
- name of the hash key valuepublic TableWriteItems addHashOnlyPrimaryKeysToDelete(java.lang.String hashKeyName, java.lang.Object... hashKeyValues)
hashKeyName
- name of the hash key attribute namehashKeyValues
- multiple hash key valuespublic TableWriteItems addHashAndRangePrimaryKeysToDelete(java.lang.String hashKeyName, java.lang.String rangeKeyName, java.lang.Object... alternatingHashRangeKeyValues)
hashKeyName
- name of the hash key attribute namerangeKeyName
- name of the range key attribute namealternatingHashRangeKeyValues
- used to specify multiple alternating hash key and range key
valuespublic TableWriteItems addHashAndRangePrimaryKeyToDelete(java.lang.String hashKeyName, java.lang.Object hashKeyValue, java.lang.String rangeKeyName, java.lang.Object rangeKeyValue)
hashKeyName
- hash key attribute namehashKeyValue
- hash key valuerangeKeyName
- range key attribute namerangeKeyValue
- range key valuepublic TableWriteItems withItemsToPut(Item... itemsToPut)
public TableWriteItems withItemsToPut(java.util.Collection<Item> itemsToPut)
public java.util.Collection<Item> getItemsToPut()
public java.lang.String getTableName()
public TableWriteItems addItemToPut(Item item)