Interface KeysAwareEncoder
- All Superinterfaces:
AutoCloseable, Encoder
- All Known Implementing Classes:
BsonWriterEncoder, JacksonEncoder
Optional encoder capability for writing object keys from a known key set.
- Since:
- 3.1
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionvoidEncode a key by index from the supplied key set.static KeysAwareEncoderAdapt the encoder to the keys-aware contract.Methods inherited from interface Encoder
close, currentPath, encodeArray, encodeBigDecimal, encodeBigInteger, encodeBinary, encodeBoolean, encodeByte, encodeChar, encodeDouble, encodeFloat, encodeInt, encodeKey, encodeLong, encodeNull, encodeObject, encodeShort, encodeString, finishStructure
-
Method Details
-
of
Adapt the encoder to the keys-aware contract.- Parameters:
encoder- The encoder- Returns:
- A keys-aware encoder
-
encodeKey
Encode a key by index from the supplied key set.- Parameters:
keys- The keysindex- The key index- Throws:
IOException- If an unrecoverable error occurs
-