Class JsonWriterConfig
java.lang.Object
io.vertx.grpc.common.JsonWriterConfig
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanalwaysPrintFieldsWithNoPresence(boolean value) booleanomittingInsignificantWhitespace(boolean value) booleanpreservingProtoFieldNames(boolean value) booleanprintingEnumsAsInts(boolean value) booleansortingMapKeys(boolean value)
-
Field Details
-
DEFAULT
-
-
Method Details
-
alwaysPrintFieldsWithNoPresence
public boolean alwaysPrintFieldsWithNoPresence()- Returns:
- whether fields without presence are always printed, including those left at their default value
-
alwaysPrintFieldsWithNoPresence
- Returns:
- a copy of this format with
alwaysPrintFieldsWithNoPresenceset tovalue
-
omittingInsignificantWhitespace
public boolean omittingInsignificantWhitespace()- Returns:
- whether insignificant whitespace is omitted, producing a compact single-line output
-
omittingInsignificantWhitespace
- Returns:
- a copy of this format with
omittingInsignificantWhitespaceset tovalue
-
preservingProtoFieldNames
public boolean preservingProtoFieldNames()- Returns:
- whether the original proto field names are used instead of the lowerCamelCase JSON names
-
preservingProtoFieldNames
- Returns:
- a copy of this format with
preservingProtoFieldNamesset tovalue
-
printingEnumsAsInts
public boolean printingEnumsAsInts()- Returns:
- whether enum values are printed as their integer number instead of their name
-
printingEnumsAsInts
- Returns:
- a copy of this format with
printingEnumsAsIntsset tovalue
-
sortingMapKeys
public boolean sortingMapKeys()- Returns:
- whether map entries are emitted with their keys sorted, for deterministic output
-
sortingMapKeys
- Returns:
- a copy of this format with
sortingMapKeysset tovalue
-