Class MessageValue
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.MessageValue
-
@API(EXPERIMENTAL) public class MessageValue extends Object
A utility class for extracting data and meta-data from Protocol BufferMessage
s, as used in the Record Layer.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Descriptors.FieldDescriptor
findFieldDescriptorOnMessage(MessageOrBuilder message, String fieldName)
static Object
getFieldOnMessage(MessageOrBuilder message, String fieldName)
Get the value of the field with the given field name on the given message.static Object
getFieldValue(MessageOrBuilder message, List<String> fieldNames)
Get the value of the (nested) field on the path from the message defined byfieldNames
.
-
-
-
Method Detail
-
getFieldValue
@Nullable public static Object getFieldValue(@Nonnull MessageOrBuilder message, @Nonnull List<String> fieldNames)
Get the value of the (nested) field on the path from the message defined byfieldNames
. The given field names define a path through the nested structure of the given message; this method traverses that path and returns the value at the leaf, using the return semantics ofgetFieldOnMessage(MessageOrBuilder, String)
.- Parameters:
message
- a messagefieldNames
- a list of field names defining a path starting atmessage
- Returns:
- the value at the end of hte path
-
getFieldOnMessage
@Nullable public static Object getFieldOnMessage(@Nonnull MessageOrBuilder message, @Nonnull String fieldName)
Get the value of the field with the given field name on the given message. If the field is repeated, the repeated values are combined into a list. If the field has a message type, the value is returned as aMessage
of that type. Otherwise, the field is returned as a primitive.- Parameters:
message
- a message or builder to extract the field fromfieldName
- the field to extract- Returns:
- the value of the field as described above
-
findFieldDescriptorOnMessage
@Nonnull public static Descriptors.FieldDescriptor findFieldDescriptorOnMessage(@Nonnull MessageOrBuilder message, @Nonnull String fieldName)
-
-