Class JsonWriterConfig

java.lang.Object
io.vertx.grpc.common.JsonWriterConfig

public class JsonWriterConfig extends Object
Carries the protobuf-aware writer flags that the JSON encoder consults.

Instances are immutable. Each flag setter returns a new instance with that flag updated:

  JsonWriterConfig verbose = JsonWriterConfig.DEFAULT
    .alwaysPrintFieldsWithNoPresence(true);
  • Field Details

  • Method Details

    • alwaysPrintFieldsWithNoPresence

      public boolean alwaysPrintFieldsWithNoPresence()
      Returns:
      whether fields without presence are always printed, including those left at their default value
    • alwaysPrintFieldsWithNoPresence

      public JsonWriterConfig alwaysPrintFieldsWithNoPresence(boolean value)
      Returns:
      a copy of this format with alwaysPrintFieldsWithNoPresence set to value
    • omittingInsignificantWhitespace

      public boolean omittingInsignificantWhitespace()
      Returns:
      whether insignificant whitespace is omitted, producing a compact single-line output
    • omittingInsignificantWhitespace

      public JsonWriterConfig omittingInsignificantWhitespace(boolean value)
      Returns:
      a copy of this format with omittingInsignificantWhitespace set to value
    • preservingProtoFieldNames

      public boolean preservingProtoFieldNames()
      Returns:
      whether the original proto field names are used instead of the lowerCamelCase JSON names
    • preservingProtoFieldNames

      public JsonWriterConfig preservingProtoFieldNames(boolean value)
      Returns:
      a copy of this format with preservingProtoFieldNames set to value
    • printingEnumsAsInts

      public boolean printingEnumsAsInts()
      Returns:
      whether enum values are printed as their integer number instead of their name
    • printingEnumsAsInts

      public JsonWriterConfig printingEnumsAsInts(boolean value)
      Returns:
      a copy of this format with printingEnumsAsInts set to value
    • sortingMapKeys

      public boolean sortingMapKeys()
      Returns:
      whether map entries are emitted with their keys sorted, for deterministic output
    • sortingMapKeys

      public JsonWriterConfig sortingMapKeys(boolean value)
      Returns:
      a copy of this format with sortingMapKeys set to value