Send feedback
Class KeySet (6.74.1)
Stay organized with collections
Save and categorize content based on your preferences.
Version 6.74.1 keyboard_arrow_down
public final class KeySet implements Serializable
Defines a collection of Cloud Spanner keys and/or key ranges. All the keys are expected to be in
the same table or index. The keys need not be sorted in any particular way.
If the same key is specified multiple times in the set (for example if two ranges, two keys,
or a key and a range overlap), the Cloud Spanner backend behaves as if the key were only
specified once. However, the KeySet
object itself does not perform any de-duplication.
KeySet
instances are immutable.
Static Methods
all()
public static KeySet all ()
Creates a key set that will retrieve all rows of a table or index.
Returns
Type
Description
KeySet
newBuilder()
public static KeySet . Builder newBuilder ()
Returns a new builder that can be used to construct a key set.
prefixRange(Key prefix)
public static KeySet prefixRange ( Key prefix )
Creates a key set that covers all keys where the first prefix.size()
components match
prefix
exactly.
Parameter
Name
Description
prefix
Key
Returns
Type
Description
KeySet
range(KeyRange range)
public static KeySet range ( KeyRange range )
Creates a key set containing a single range. See KeyRange for details of how to specify
ranges.
Parameter
Name
Description
range
KeyRange
Returns
Type
Description
KeySet
singleKey(Key key)
public static KeySet singleKey ( Key key )
Creates a key set containing a single key. key
should contain exactly as many elements
as there are columns in the primary or index key with this this key set is used.
Parameter
Name
Description
key
Key
Returns
Type
Description
KeySet
Methods
equals(Object o)
public boolean equals ( Object o )
Parameter
Name
Description
o
Object
Overrides
getKeys()
public Iterable<Key> getKeys ()
Returns the keys in this set.
getRanges()
public Iterable<KeyRange> getRanges ()
Returns the ranges in this set.
hashCode()
Returns
Type
Description
int
Overrides
isAll()
Indicates whether the set will retrieve all rows in a table or index.
toBuilder()
public KeySet . Builder toBuilder ()
Returns a builder initialized with the contents of this set.
toString()
Returns
Type
Description
String
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-04 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-10-04 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-04 UTC."]]