public interface KeyRenderer extends KeyCoder
An extended KeyCoder
that can populate a supplied Object
with data that was formerly written to a Key
by the
KeyCoder
.
A KeyRenderer
implements an additional method called
renderKeySegment(com.persistit.Key, java.lang.Object, java.lang.Class<?>, com.persistit.encoding.CoderContext)
that populates a supplied target object rather than
creating a new object instance.
Modifier and Type | Method and Description |
---|---|
void |
renderKeySegment(Key key,
Object target,
Class<?> clazz,
CoderContext context)
Populate the state of the supplied target
Object by decoding
the next key segment of the supplied Key . |
appendKeySegment, decodeKeySegment, isZeroByteFree
void renderKeySegment(Key key, Object target, Class<?> clazz, CoderContext context) throws ConversionException
Populate the state of the supplied target Object
by decoding
the next key segment of the supplied Key
. This method will
be called only if this KeyRenderer
has been registered with
the current CoderManager
to encode objects having the supplied
Class
value. In addition, Persistit will never call this
method to decode a value that was null
when written because
null values are handled by built-in encoding logic.
When this method is called the value Key.getIndex()
will be the
offset within the key of the first encoded byte. The key segment is
zero-byte terminated.
key
- The Key
from which interior fields of the object
are to be retrievedtarget
- An object into which the key segment is to be writtenclazz
- The class of the object that was originally encoded into
Value.context
- An arbitrary object that can optionally be supplied by the
application to convey an application-specific context for the
operation. (See CoderContext
.) The default value is
null
.ConversionException
Copyright © 2025 Open Identity Platform Community. All rights reserved.