nl.topicus.jdbc.shaded.com.google.cloud.spanner.Key Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spanner-jdbc Show documentation
Show all versions of spanner-jdbc Show documentation
JDBC Driver for Google Cloud Spanner
/*
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.topicus.jdbc.shaded.com.google.cloud.spanner;
import static nl.topicus.jdbc.shaded.com.google.common.base.Preconditions.checkNotNull;
import nl.topicus.jdbc.shaded.com.google.cloud.ByteArray;
import nl.topicus.jdbc.shaded.com.google.cloud.Date;
import nl.topicus.jdbc.shaded.com.google.cloud.Timestamp;
import nl.topicus.jdbc.shaded.com.google.common.base.Joiner;
import nl.topicus.jdbc.shaded.com.google.protobuf.ListValue;
import nl.topicus.jdbc.shaded.com.google.protobuf.NullValue;
import nl.topicus.jdbc.shaded.com.google.protobuf.Value;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import nl.topicus.jdbc.shaded.javax.annotation.Nullable;
/**
* Represents 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 {@code BOOLEAN}, {@code INT64}, {@code
* FLOAT64}, {@code STRING}, {@code BYTES} and {@code TIMESTAMP}. Values may be null where the table
* definition permits it.
*
* {@code 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.
*
*
{@code Key} instances are immutable.
*/
public final class Key implements Serializable {
private static final Joiner joiner = Joiner.on(',').useForNull("");
private static final nl.topicus.jdbc.shaded.com.google.protobuf.Value NULL_PROTO =
Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build();
private static final long serialVersionUID = 4433485671785063530L;
private final List