T
- the type of the literal value@API(value=MAINTAINED) public class LiteralKeyExpression<T> extends BaseKeyExpression implements AtomKeyExpression
FunctionKeyExpression
for details).BaseKeyExpression.IllegalSubKeyException, BaseKeyExpression.UnsplittableKeyExpressionException
KeyExpression.DeserializationException, KeyExpression.FanType, KeyExpression.InvalidExpressionException, KeyExpression.InvalidResultException, KeyExpression.NoSuchArgumentException, KeyExpression.SerializationException
Constructor and Description |
---|
LiteralKeyExpression(T value) |
Modifier and Type | Method and Description |
---|---|
boolean |
createsDuplicates()
This states whether the given expression type is capable of evaluating more to more than
one value when applied to a single record.
|
boolean |
equals(Object o) |
boolean |
equalsAtomic(AtomKeyExpression other) |
<M extends Message> |
evaluateMessage(FDBRecord<M> record,
Message message)
Evaluate this expression against a record or a Protobuf message.
|
static LiteralKeyExpression<?> |
fromProto(RecordMetaDataProto.Value proto) |
static Object |
fromProtoValue(RecordMetaDataProto.Value proto) |
int |
getColumnSize()
Returns the number of items in each KeyValue that will be returned.
|
T |
getValue() |
int |
hashCode() |
int |
planHash()
Return a hash similar to
hashCode , but with the additional guarantee that is is stable across JVMs. |
RecordMetaDataProto.KeyExpression |
toKeyExpression() |
RecordMetaDataProto.Value |
toProto() |
static RecordMetaDataProto.Value |
toProtoValue(Object value) |
String |
toString() |
List<Descriptors.FieldDescriptor> |
validate(Descriptors.Descriptor descriptor)
Validate this expression against a given record type descriptor.
|
getSubKey, getSubKeyImpl, isPrefixKey
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
evaluate, evaluateSingleton, fromProto, getSubKey, hasProperInterfaces, hasRecordTypeKey, isPrefixKey, normalizeKeyForPositions, versionColumns
combineHashes, iterablePlanHash, objectPlanHash, objectsPlanHash, planHash, planHash, planHashUnordered, stringHashUnordered
@Nonnull public <M extends Message> List<Key.Evaluated> evaluateMessage(@Nullable FDBRecord<M> record, @Nullable Message message)
KeyExpression
evaluateMessage
.
Under ordinary circumstances, if record
is null
, then message
will be null
.
Otherwise, message
will be record.getRecord()
or some submessage of that, possibly null
if
the corresponding field is missing.evaluateMessage
in interface KeyExpression
M
- the type of recordrecord
- the recordmessage
- the Protobuf message to evaluate againstKeyExpression.evaluate(com.apple.foundationdb.record.provider.foundationdb.FDBRecord<M>)
public boolean createsDuplicates()
KeyExpression
FanType.FanOut
set (either directly
or indirectly).createsDuplicates
in interface KeyExpression
true
if this expression can evaluate to multiple values and false
otherwisepublic List<Descriptors.FieldDescriptor> validate(@Nonnull Descriptors.Descriptor descriptor)
KeyExpression
validate
in interface KeyExpression
descriptor
- the descriptor for the record type or submessagepublic int getColumnSize()
KeyExpression
KeyExpression.FanType.Concatenate
, this will the count of non-nested lists, i.e. this will be value of
evaluate(r).get(i).toList().size() for any i or r.getColumnSize
in interface KeyExpression
@Nonnull public RecordMetaDataProto.Value toProto() throws KeyExpression.SerializationException
toProto
in interface KeyExpression
KeyExpression.SerializationException
@Nonnull public RecordMetaDataProto.KeyExpression toKeyExpression()
toKeyExpression
in interface KeyExpression
@Nonnull public static LiteralKeyExpression<?> fromProto(RecordMetaDataProto.Value proto)
@Nullable public static Object fromProtoValue(RecordMetaDataProto.Value proto)
@Nonnull public static RecordMetaDataProto.Value toProtoValue(@Nullable Object value)
public boolean equalsAtomic(AtomKeyExpression other)
equalsAtomic
in interface AtomKeyExpression
public int planHash()
PlanHashable
hashCode
, but with the additional guarantee that is is stable across JVMs.planHash
in interface PlanHashable