- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines a mechanism for converting a path segment to a map key. A
KeyDeserializer can optionally be passed to the
constructor of the
PathWalker class. It is needed when reading or writing to objects that
are, or contain maps with a non-String key type.-
Method Summary
Modifier and TypeMethodDescriptiondeserialize(Path path, int segmentIndex) Converts the path segment at the specified index to a map key.
-
Method Details
-
deserialize
Converts the path segment at the specified index to a map key. If deserialization fails in a non-fatal way, aKeyDeserializationExceptionshould be thrown. Withexception suppressiondisabled, this exception will be converted to aPathWalkerExceptionwith error codeKEY_DESERIALIZATION_FAILED. With exception suppression enabled, however, the exception will be ignored, like any of the anticipated errors inErrorCode. Thereadmethods will simply returnnullfor the path in question, while thewritemethods will tacitly abort the attempt to set the path's value.- Parameters:
path- the path containing the segmentsegmentIndex- the index of the segment- Returns:
- the map key
- Throws:
KeyDeserializationException- If key deserialization fails in a non-fatal way
-