Package com.google.protobuf
Class MessageLiteToString
- java.lang.Object
-
- com.google.protobuf.MessageLiteToString
-
final class MessageLiteToString extends java.lang.Object
Helps generateString
representations ofMessageLite
protos.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
BUILDER_LIST_SUFFIX
private static java.lang.String
BYTES_SUFFIX
private static char[]
INDENT_BUFFER
private static java.lang.String
LIST_SUFFIX
private static java.lang.String
MAP_SUFFIX
-
Constructor Summary
Constructors Constructor Description MessageLiteToString()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
indent(int indent, java.lang.StringBuilder buffer)
private static boolean
isDefaultValue(java.lang.Object o)
private static java.lang.String
pascalCaseToSnakeCase(java.lang.String pascalCase)
(package private) static void
printField(java.lang.StringBuilder buffer, int indent, java.lang.String name, java.lang.Object object)
Formats a text proto field.private static void
reflectivePrintWithIndent(MessageLite messageLite, java.lang.StringBuilder buffer, int indent)
Reflectively prints theMessageLite
to the buffer at givenindent
level.(package private) static java.lang.String
toString(MessageLite messageLite, java.lang.String commentString)
Returns aString
representation of theMessageLite
object.
-
-
-
Field Detail
-
LIST_SUFFIX
private static final java.lang.String LIST_SUFFIX
- See Also:
- Constant Field Values
-
BUILDER_LIST_SUFFIX
private static final java.lang.String BUILDER_LIST_SUFFIX
- See Also:
- Constant Field Values
-
MAP_SUFFIX
private static final java.lang.String MAP_SUFFIX
- See Also:
- Constant Field Values
-
BYTES_SUFFIX
private static final java.lang.String BYTES_SUFFIX
- See Also:
- Constant Field Values
-
INDENT_BUFFER
private static final char[] INDENT_BUFFER
-
-
Method Detail
-
toString
static java.lang.String toString(MessageLite messageLite, java.lang.String commentString)
Returns aString
representation of theMessageLite
object. The first line of theString
representation 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.For use by generated code only.
-
reflectivePrintWithIndent
private static void reflectivePrintWithIndent(MessageLite messageLite, java.lang.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
private static boolean isDefaultValue(java.lang.Object o)
-
printField
static void printField(java.lang.StringBuilder buffer, int indent, java.lang.String name, java.lang.Object object)
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
private static void indent(int indent, java.lang.StringBuilder buffer)
-
pascalCaseToSnakeCase
private static java.lang.String pascalCaseToSnakeCase(java.lang.String pascalCase)
-
-