Package com.yahoo.search.rendering
Class JsonRenderer.FieldConsumer
java.lang.Object
com.yahoo.search.rendering.JsonRenderer.FieldConsumer
- All Implemented Interfaces:
com.yahoo.container.logging.TraceRenderer.FieldConsumer,Hit.RawUtf8Consumer,BiConsumer<String,Object>
- Enclosing class:
- JsonRenderer
public static class JsonRenderer.FieldConsumer
extends Object
implements Hit.RawUtf8Consumer, com.yahoo.container.logging.TraceRenderer.FieldConsumer
Received callbacks when fields of hits are encountered.
This instance is reused for all hits of a Result since we are in a single-threaded context
and want to limit object creation.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFieldConsumer(boolean debugRendering, boolean tensorShortForm, boolean jsonMaps) Invoke this from your constructor when sub-classingJsonRenderer.FieldConsumer -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCalled for fields which are available as UTF-8 instead of accept(String, Object).voidprotected voidrenderFieldContents(Object field) protected booleanshouldRender(String name, Object value) protected booleanshouldRenderUtf8Value(String name, int length) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiConsumer
andThen
-
Constructor Details
-
FieldConsumer
protected FieldConsumer(boolean debugRendering, boolean tensorShortForm, boolean jsonMaps) Invoke this from your constructor when sub-classingJsonRenderer.FieldConsumer
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<String,Object>
-
accept
Description copied from interface:Hit.RawUtf8ConsumerCalled for fields which are available as UTF-8 instead of accept(String, Object).- Specified by:
acceptin interfaceHit.RawUtf8Consumer- Parameters:
name- the name of the fieldutf8Data- raw utf-8 data. The receiver must not modify this dataoffset- the start index in the utf8Data array of the data to acceptlength- the length starting from offset in the utf8Data array of the data to accept
-
shouldRender
-
shouldRenderUtf8Value
-
renderFieldContents
- Throws:
IOException
-
accept
- Specified by:
acceptin interfacecom.yahoo.container.logging.TraceRenderer.FieldConsumer- Throws:
IOException
-