Class ProtobufKeysProvider
java.lang.Object
io.micronaut.serde.protobuf.ProtobufKeysProvider
- All Implemented Interfaces:
KeysProvider
Contributes the property names of a
Keys set to the protobuf backend.
Object properties are dispatched by index, but protobuf needs the field number the index stands for, and that is only reachable through the property name. Contributing the names here lets the encoder and decoder translate an index into a field number without a per-property lookup on the hot path.
- Since:
- 3.2
-
Constructor Details
-
ProtobufKeysProvider
public ProtobufKeysProvider()Default constructor.
-
-
Method Details
-
keysType
Description copied from interface:KeysProviderThe contribution type supplied by this provider.- Specified by:
keysTypein interfaceKeysProvider- Returns:
- The contribution type
-
create
Description copied from interface:KeysProviderCreate backend-specific data for the supplied keys. The returned value must be safe to reuse across encoder and decoder instances.- Specified by:
createin interfaceKeysProvider- Parameters:
keys- The keys- Returns:
- The backend-specific data
-