public final class Key extends Object implements Serializable
BOOLEAN, INT64, FLOAT64, STRING, BYTES and TIMESTAMP. Values may be null where the table
definition permits it.
Key is used to define the row, or endpoints of a range of rows, to retrieve in read
operations or to delete in a mutation.
Key instances are immutable.
| Modifier and Type | Class and Description |
|---|---|
static class |
Key.Builder
Builder for
Key instances. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Iterable<Object> |
getParts()
Returns the parts in this key.
|
int |
hashCode() |
static Key.Builder |
newBuilder()
Returns a new builder for constructing a key.
|
static Key |
of(Object... values)
Construct a key with parts specified by
values. |
int |
size()
Returns the number of parts in this key, including
null values. |
Key.Builder |
toBuilder()
Returns a builder initialized with the value of this key.
|
String |
toString() |
public static Key of(Object... values)
values. Each object in values must be
either null or one of the following supported types:
Boolean for the BOOL Cloud Spanner type
Integer, Long for INT64
Float, Double for FLOAT64
String for STRING
ByteArray for BYTES
IllegalArgumentException - if any member of values is not a supported typepublic static Key.Builder newBuilder()
public int size()
null values.public Iterable<Object> getParts()
of(Object...) are converted to one of the canonical types.
BOOL is represented by Boolean
INT64 is represented by Long
FLOAT64 is represented by Double
STRING is represented by String
BYTES is represented by ByteArray
TIMESTAMP is represented by Timestamp
DATE is represented by Date
public Key.Builder toBuilder()
Copyright © 2019 Google LLC. All rights reserved.