Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Static content insertion into existing JSON documents

Christian Kreutzfeldt edited this page Apr 28, 2016 · 2 revisions

This operator inserts static values into existing JSON documents. Its behavior is configured during instantiation where it receives a list of key/value pairs holding paths along with values to insert at the referenced locations.

  List<Pair<JsonContentReference, Serializable>> values = new ArrayList<>();
  values.add(new ImmutablePair<JsonContentReference, Serializable>(
       new JsonContentReference(
          new String[]{"valid"}, JsonContentType.STRING), "test"));		
  JsonStaticContentInsertion inserter = new JsonStaticContentInsertion(values);

  dataStream.map(inserter);