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 voidindent(int indent, StringBuilder buffer) private static booleanprivate static StringpascalCaseToSnakeCase(String pascalCase) (package private) static voidprintField(StringBuilder buffer, int indent, String name, Object object) Formats a text proto field.private static voidreflectivePrintWithIndent(MessageLite messageLite, StringBuilder buffer, int indent) Reflectively prints theMessageLiteto the buffer at givenindentlevel.(package private) static StringtoString(MessageLite messageLite, String commentString) Returns aStringrepresentation of theMessageLiteobject.
-
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 aStringrepresentation of theMessageLiteobject. The first line of theStringrepresentation 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 theMessageLiteto the buffer at givenindentlevel.- 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
-