Interface JsonProducer

All Known Implementing Classes:
FeatureData, PositionsData, StructuredData

public interface JsonProducer
Generic API for classes that contain data representable as JSON.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Convenience method equivalent to writeJson(new StringBuilder()).toString()
    Append the JSON representation of this object's data to a StringBuilder.
  • Method Details

    • writeJson

      StringBuilder writeJson(StringBuilder target)
      Append the JSON representation of this object's data to a StringBuilder.
      Parameters:
      target - the StringBuilder to append to
      Returns:
      the target passed in is also returned (to allow chaining)
    • toJson

      default String toJson()
      Convenience method equivalent to writeJson(new StringBuilder()).toString()
      Returns:
      a String containing JSON representation of this object's data