Class Key.Evaluated
- java.lang.Object
-
- com.apple.foundationdb.record.metadata.Key.Evaluated
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Key.Evaluated.NullStandin
Values used in index keys in place of missing fields.
-
Field Summary
Fields Modifier and Type Field Description static Key.Evaluated
EMPTY
A key containing no elements.static Key.Evaluated
NULL
A key containing just the null element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Key.Evaluated
append(Key.Evaluated secondValue)
Creates a new key by appending another key to this one.static Key.Evaluated
concatenate(Object first, Object... rest)
Primarily for tests, shorthand for creating a concatenation with a bunch of elements, see concatenate.static Key.Evaluated
concatenate(List<Object> values)
Take a list of scalars and concatenate them in a single key.boolean
containsNonUniqueNull()
Check for NULL value that inhibits unique indexes.boolean
equals(Object o)
static List<Key.Evaluated>
fan(List<Object> valuesToAdd)
Fanout a list of scalars into a key for each value.static Key.Evaluated
fromTuple(Tuple tuple)
Take aTuple
and create the corresponding key from it.double
getDouble(int idx)
float
getFloat(int idx)
long
getLong(int idx)
Double
getNullableDouble(int idx)
Float
getNullableFloat(int idx)
Long
getNullableLong(int idx)
Object
getObject(int idx)
<T> T
getObject(int idx, Class<T> clazz)
String
getString(int idx)
int
hashCode()
static Key.Evaluated
scalar(Object object)
Creates a new key with just a single value.int
size()
Key.Evaluated
subKey(int start, int end)
List<Object>
toList()
Converts to a list.String
toString()
Tuple
toTuple()
Convert this key to the correspondingTuple
that can then be serialized into the database.List<Object>
toTupleAppropriateList()
Converts to a list.List<Object>
values()
-
-
-
Field Detail
-
EMPTY
public static final Key.Evaluated EMPTY
A key containing no elements.
-
NULL
public static final Key.Evaluated NULL
A key containing just the null element.
-
-
Method Detail
-
scalar
@Nonnull public static Key.Evaluated scalar(@Nullable Object object)
Creates a new key with just a single value.- Parameters:
object
- the lone value in the key- Returns:
- a new key for the one value
-
fan
@Nonnull public static List<Key.Evaluated> fan(@Nonnull List<Object> valuesToAdd)
Fanout a list of scalars into a key for each value.- Parameters:
valuesToAdd
- the list of scalars- Returns:
- one key for each value in valuesToAdd
-
concatenate
@Nonnull public static Key.Evaluated concatenate(@Nonnull List<Object> values)
Take a list of scalars and concatenate them in a single key. Note this is a key containing the list of values, as opposed to a key with a single value that is a list.- Parameters:
values
- the values to combine together into a key- Returns:
- a new key with the given values
-
concatenate
@Nonnull public static Key.Evaluated concatenate(@Nullable Object first, @Nullable Object... rest)
Primarily for tests, shorthand for creating a concatenation with a bunch of elements, see concatenate.- Parameters:
first
- the first value to be concatenated, avoids type conflicts with the other concatenaterest
- the rest of the values- Returns:
- a new key consisting of the provided values
-
fromTuple
@Nonnull public static Key.Evaluated fromTuple(@Nonnull Tuple tuple)
Take aTuple
and create the corresponding key from it.- Parameters:
tuple
- the tuple to convert- Returns:
- a new key based on the given tuple
-
toTuple
@Nonnull public Tuple toTuple()
Convert this key to the correspondingTuple
that can then be serialized into the database.- Returns:
- this key converted into a
Tuple
-
getLong
public long getLong(int idx)
-
getDouble
public double getDouble(int idx)
-
getFloat
public float getFloat(int idx)
-
append
@Nonnull public Key.Evaluated append(@Nonnull Key.Evaluated secondValue)
Creates a new key by appending another key to this one.- Parameters:
secondValue
- another key that will form the second part of the new key.- Returns:
- a new key consisting of the elements in this key, and then the elements of the second key
-
toList
@Nonnull public List<Object> toList()
Converts to a list. Useful for creating tuples- Returns:
- the elements of this key value
-
toTupleAppropriateList
@Nonnull public List<Object> toTupleAppropriateList()
Converts to a list. Useful for creating tuples. If possible the underlying objects will be converted to types that Tuple can handle.- Returns:
- the elements of this key value
-
containsNonUniqueNull
public boolean containsNonUniqueNull()
Check for NULL value that inhibits unique indexes.- Returns:
true
if this has a null value
-
size
public int size()
-
subKey
public Key.Evaluated subKey(int start, int end)
-
-