Interface GrpcJsonReverseTranscoder.PrintOptionsOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
GrpcJsonReverseTranscoder.PrintOptions,GrpcJsonReverseTranscoder.PrintOptions.Builder
- Enclosing class:
- GrpcJsonReverseTranscoder
public static interface GrpcJsonReverseTranscoder.PrintOptionsOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to always print enums as ints.booleanWhether to always print primitive fields.booleanWhether to convert the proto field names to ``json_name`` annotation value, or lower camel case, in absence of ``json_name``.Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitializedMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getAlwaysPrintPrimitiveFields
boolean getAlwaysPrintPrimitiveFields()Whether to always print primitive fields. By default primitive fields with default values will be omitted in JSON output. For example, an int32 field set to 0 will be omitted. Setting this flag to true will override the default behavior and print primitive fields regardless of their values. Defaults to false.
bool always_print_primitive_fields = 1;- Returns:
- The alwaysPrintPrimitiveFields.
-
getAlwaysPrintEnumsAsInts
boolean getAlwaysPrintEnumsAsInts()Whether to always print enums as ints. By default they are rendered as strings. Defaults to false.
bool always_print_enums_as_ints = 2;- Returns:
- The alwaysPrintEnumsAsInts.
-
getUseCanonicalFieldNames
boolean getUseCanonicalFieldNames()Whether to convert the proto field names to ``json_name`` annotation value, or lower camel case, in absence of ``json_name``. By default the field names will be preserved after conversion. Setting this flag will convert the field names to their canonical form. Defaults to false. Example: .. code-block:: proto message Author { int64 id = 1; enum Gender { UNKNOWN = 0; MALE = 1; FEMALE = 2; }; Gender gender = 2; string first_name = 3; string last_name = 4 [json_name = "lname"]; } The above proto message after being transcoded to JSON with ``use_canonical_field_names`` set to ``false`` will have the field names same as in the proto message, as follows: .. code-block:: json { "id": "12345", "gender": "MALE", "first_name": "John", "last_name": "Doe" } and with the ``use_canonical_field_names`` set to ``true``, the transcoded JSON will have ``first_name`` converted to camelCase and ``last_name`` converted to its ``json_name`` annotation value, as follows: .. code-block:: json { "id": "12345", "gender": "MALE", "firstName": "John", "lname": "Doe" }bool use_canonical_field_names = 3;- Returns:
- The useCanonicalFieldNames.
-