Class TypedRecordSerializer<M extends Message,U extends Message,B extends Message.Builder>
- java.lang.Object
-
- com.apple.foundationdb.record.provider.common.MessageBuilderRecordSerializerBase<M,U,B>
-
- com.apple.foundationdb.record.provider.common.TypedRecordSerializer<M,U,B>
-
- Type Parameters:
M
- generated Protobuf class for the record message typeU
- generated Protobuf class for the union messageB
- generated Protobuf class for the union message's builder
- All Implemented Interfaces:
RecordSerializer<M>
@API(UNSTABLE) public class TypedRecordSerializer<M extends Message,U extends Message,B extends Message.Builder> extends MessageBuilderRecordSerializerBase<M,U,B>
Serialize records using default Protobuf serialization using supplied message builder for the union message type and two accessors for the message field corresponding to the known record type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apple.foundationdb.record.provider.common.RecordSerializer
RecordSerializer.Counts, RecordSerializer.Events
-
-
Constructor Summary
Constructors Constructor Description TypedRecordSerializer(Descriptors.FieldDescriptor fieldDescriptor, Supplier<B> builderSupplier, Predicate<U> tester, Function<U,M> getter, BiConsumer<B,M> setter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected M
getUnionField(Descriptors.Descriptor unionDescriptor, U storedRecord)
protected void
setUnionField(RecordMetaData metaData, RecordType recordType, B unionBuilder, M record)
-
Methods inherited from class com.apple.foundationdb.record.provider.common.MessageBuilderRecordSerializerBase
deserialize, serialize, widen
-
-
-
-
Method Detail
-
setUnionField
protected void setUnionField(@Nonnull RecordMetaData metaData, @Nonnull RecordType recordType, @Nonnull B unionBuilder, @Nonnull M record)
- Specified by:
setUnionField
in classMessageBuilderRecordSerializerBase<M extends Message,U extends Message,B extends Message.Builder>
-
getUnionField
@Nonnull protected M getUnionField(@Nonnull Descriptors.Descriptor unionDescriptor, @Nonnull U storedRecord)
- Specified by:
getUnionField
in classMessageBuilderRecordSerializerBase<M extends Message,U extends Message,B extends Message.Builder>
-
-