- 6.102.0 (latest)
- 6.101.1
- 6.100.0
- 6.99.0
- 6.98.1
- 6.97.1
- 6.96.1
- 6.95.1
- 6.94.0
- 6.93.0
- 6.89.0
- 6.88.0
- 6.87.0
- 6.86.0
- 6.85.0
- 6.83.0
- 6.82.0
- 6.80.1
- 6.79.0
- 6.77.0
- 6.74.1
- 6.72.0
- 6.71.0
- 6.69.0
- 6.68.0
- 6.66.0
- 6.65.1
- 6.62.0
- 6.60.0
- 6.58.0
- 6.57.0
- 6.56.0
- 6.55.0
- 6.54.0
- 6.53.0
- 6.52.1
- 6.51.0
- 6.50.1
- 6.49.0
- 6.25.1
- 6.24.0
- 6.23.4
- 6.22.0
- 6.21.2
- 6.20.0
- 6.19.1
- 6.18.0
- 6.17.4
- 6.14.1
public final class Key implements SerializableRepresents a row key in a Cloud Spanner table or index. A key is a tuple of values constrained to
the scalar Cloud Spanner types: currently these are 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.
Implements
SerializableStatic Methods
newBuilder()
public static Key.Builder newBuilder()Returns a new builder for constructing a key.
| Returns | |
|---|---|
| Type | Description |
Key.Builder |
|
of(Object[] values)
public static Key of(Object[] values)Construct a key with parts specified by values. Each object in values must be
either null or one of the following supported types:
Booleanfor theBOOLCloud Spanner typeInteger,Longfor theINT64Cloud Spanner typeFloat,Doublefor theFLOAT64Cloud Spanner typeBigDecimalfor theNUMERICCloud Spanner typeStringfor theSTRINGCloud Spanner typeStringfor theJSONCloud Spanner type- ByteArray for the
BYTESCloud Spanner type - Timestamp for the
TIMESTAMPCloud Spanner type - Date for the
DATECloud Spanner type - java.util.UUID for the
UUIDCloud Spanner type
| Parameter | |
|---|---|
| Name | Description |
values |
Object[] |
| Returns | |
|---|---|
| Type | Description |
Key |
|
Methods
equals(Object o)
public boolean equals(Object o)| Parameter | |
|---|---|
| Name | Description |
o |
Object |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
getParts()
public Iterable<Object> getParts()Returns the parts in this key. Each part is represented by the corresponding Cloud Spanner type's canonical Java type, as listed below. Note that other types supported by #of(Object...) are converted to one of the canonical types.
BOOLis represented byBooleanINT64is represented byLongFLOAT64is represented byDoubleNUMERICis represented byBigDecimalSTRINGis represented byStringJSONis represented byStringBYTESis represented by ByteArrayTIMESTAMPis represented by TimestampDATEis represented by Date
| Returns | |
|---|---|
| Type | Description |
Iterable<Object> |
an unmodifiable list containing the key parts |
hashCode()
public int hashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
size()
public int size()Returns the number of parts in this key, including null values.
| Returns | |
|---|---|
| Type | Description |
int |
|
toBuilder()
public Key.Builder toBuilder()Returns a builder initialized with the value of this key.
| Returns | |
|---|---|
| Type | Description |
Key.Builder |
|
toString()
public String toString()| Returns | |
|---|---|
| Type | Description |
String |
|