Package io.pravega.client.tables
Class TableEntry<KeyT,ValueT>
- java.lang.Object
-
- io.pravega.client.tables.TableEntry<KeyT,ValueT>
-
- Type Parameters:
KeyT
- Key Type.ValueT
- Value Type
public class TableEntry<KeyT,ValueT> extends java.lang.Object
AKeyValueTable
Entry.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull TableKey<KeyT>
getKey()
TheTableKey
.ValueT
getValue()
The Value.static <KeyT,ValueT>
TableEntry<KeyT,ValueT>notExists(KeyT key, ValueT value)
Creates a newTableEntry
with a version that indicates the key must not exist.java.lang.String
toString()
static <KeyT,ValueT>
TableEntry<KeyT,ValueT>unversioned(KeyT key, ValueT value)
Creates a newTableEntry
with no specific version.static <KeyT,ValueT>
TableEntry<KeyT,ValueT>versioned(KeyT key, Version version, ValueT value)
Creates a newTableEntry
with a specific key version..
-
-
-
Method Detail
-
unversioned
public static <KeyT,ValueT> TableEntry<KeyT,ValueT> unversioned(KeyT key, ValueT value)
Creates a newTableEntry
with no specific version. When used withKeyValueTable.replaceAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableEntry<KeyT, ValueT>>)
, thisTableEntry
will be treated as an unconditional update.- Type Parameters:
KeyT
- Key Type.ValueT
- Value Type.- Parameters:
key
- The Entry Key.value
- The Entry Value.- Returns:
- An unversioned
TableEntry
(version set toVersion.NO_VERSION
).
-
notExists
public static <KeyT,ValueT> TableEntry<KeyT,ValueT> notExists(KeyT key, ValueT value)
Creates a newTableEntry
with a version that indicates the key must not exist. When used withKeyValueTable.replaceAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableEntry<KeyT, ValueT>>)
, thisTableEntry
will be treated as a conditional update, conditioned on the Key not existing.- Type Parameters:
KeyT
- Key Type.ValueT
- Value Type.- Parameters:
key
- The Entry Key.value
- The Entry Value.- Returns:
- A
TableEntry
with a version set toVersion.NOT_EXISTS
.
-
versioned
public static <KeyT,ValueT> TableEntry<KeyT,ValueT> versioned(KeyT key, Version version, ValueT value)
Creates a newTableEntry
with a specific key version.. When used withKeyValueTable.replaceAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableEntry<KeyT, ValueT>>)
, thisTableEntry
will be treated as a conditional update, conditioned on the Key existing and having the specified version.- Type Parameters:
KeyT
- Key Type.ValueT
- Value Type.- Parameters:
key
- The Entry Key.value
- The Entry Value.version
- The Version to use.- Returns:
- A
TableEntry
.
-
getKey
@NonNull public @NonNull TableKey<KeyT> getKey()
TheTableKey
.- Returns:
- The content of
TableKey
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-