Package com.google.protobuf
Class MessageLiteToString
java.lang.Object
com.google.protobuf.MessageLiteToString
Helps generate
String
representations of MessageLite
protos.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
indent
(int indent, StringBuilder buffer) private static boolean
private static String
pascalCaseToSnakeCase
(String pascalCase) (package private) static void
printField
(StringBuilder buffer, int indent, String name, Object object) Formats a text proto field.private static void
reflectivePrintWithIndent
(MessageLite messageLite, StringBuilder buffer, int indent) Reflectively prints theMessageLite
to the buffer at givenindent
level.(package private) static String
toString
(MessageLite messageLite, String commentString) Returns aString
representation of theMessageLite
object.
-
Field Details
-
LIST_SUFFIX
- See Also:
-
BUILDER_LIST_SUFFIX
- See Also:
-
MAP_SUFFIX
- See Also:
-
BYTES_SUFFIX
- See Also:
-
INDENT_BUFFER
private static final char[] INDENT_BUFFER
-
-
Constructor Details
-
MessageLiteToString
private MessageLiteToString()
-
-
Method Details
-
toString
Returns aString
representation of theMessageLite
object. The first line of theString
representation includes a comment string to uniquely identify the object instance. This acts as an indicator that this should not be relied on for comparisons. -
reflectivePrintWithIndent
private static void reflectivePrintWithIndent(MessageLite messageLite, StringBuilder buffer, int indent) Reflectively prints theMessageLite
to the buffer at givenindent
level.- Parameters:
buffer
- the buffer to write toindent
- the number of spaces to indent the proto by
-
isDefaultValue
-
printField
Formats a text proto field.For use by generated code only.
- Parameters:
buffer
- the buffer to write toindent
- the number of spaces the proto should be indented byname
- the field name (in PascalCase)object
- the object value of the field
-
indent
-
pascalCaseToSnakeCase
-