Class Json.JsonBuilder<T>

java.lang.Object
io.quarkus.builder.Json.JsonBuilder<T>
Direct Known Subclasses:
Json.JsonArrayBuilder, Json.JsonObjectBuilder
Enclosing class:
Json

abstract static class Json.JsonBuilder<T> extends Object
  • Field Details

    • ignoreEmptyBuilders

      protected boolean ignoreEmptyBuilders
  • Constructor Details

    • JsonBuilder

      JsonBuilder(boolean ignoreEmptyBuilders)
      Parameters:
      ignoreEmptyBuilders - If set to true all empty builders added to this builder will be ignored during build()
  • Method Details

    • isEmpty

      abstract boolean isEmpty()
      Returns:
      true if there are no elements/properties, false otherwise
    • build

      abstract String build() throws IOException
      Returns:
      a string representation
      Throws:
      IOException
    • appendTo

      abstract void appendTo(Appendable appendable) throws IOException
      Throws:
      IOException
    • isIgnored

      protected boolean isIgnored(Object value)
      Parameters:
      value -
      Returns:
      true if the value is null or an empty builder and ignoreEmptyBuilders is set to true, false otherwise
    • isValuesEmpty

      protected boolean isValuesEmpty(Collection<Object> values)
    • self

      protected abstract T self()