Class JsonProcessor.Builder

All Implemented Interfaces:
WithJson<JsonProcessor.Builder>, ObjectBuilder<JsonProcessor>
Enclosing class:
JsonProcessor

public static class JsonProcessor.Builder extends ProcessorBase.AbstractBuilder<JsonProcessor.Builder> implements ObjectBuilder<JsonProcessor>
Builder for JsonProcessor.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • addToRoot

      public final JsonProcessor.Builder addToRoot(@Nullable Boolean value)
      Flag that forces the parsed JSON to be added at the top level of the document. target_field must not be set when this option is chosen.

      API name: add_to_root

    • addToRootConflictStrategy

      public final JsonProcessor.Builder addToRootConflictStrategy(@Nullable JsonProcessorConflictStrategy value)
      When set to replace, root fields that conflict with fields from the parsed JSON will be overridden. When set to merge, conflicting fields will be merged. Only applicable if add_to_root is set to true.

      API name: add_to_root_conflict_strategy

    • allowDuplicateKeys

      public final JsonProcessor.Builder allowDuplicateKeys(@Nullable Boolean value)
      When set to true, the JSON parser will not fail if the JSON contains duplicate keys. Instead, the last encountered value for any duplicate key wins.

      API name: allow_duplicate_keys

    • field

      public final JsonProcessor.Builder field(String value)
      Required - The field to be parsed.

      API name: field

    • targetField

      public final JsonProcessor.Builder targetField(@Nullable String value)
      The field that the converted structured object will be written into. Any existing content in this field will be overwritten.

      API name: target_field

    • self

      protected JsonProcessor.Builder self()
      Specified by:
      self in class ProcessorBase.AbstractBuilder<JsonProcessor.Builder>
    • build

      public JsonProcessor build()
      Builds a JsonProcessor.
      Specified by:
      build in interface ObjectBuilder<JsonProcessor>
      Throws:
      NullPointerException - if some of the required fields are null.