Package com.google.protobuf
Class MessageLiteToString
- java.lang.Object
-
- com.google.protobuf.MessageLiteToString
-
final class MessageLiteToString extends java.lang.ObjectHelps generateStringrepresentations ofMessageLiteprotos.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBUILDER_LIST_SUFFIXprivate static java.lang.StringBYTES_SUFFIXprivate static char[]INDENT_BUFFERprivate static java.lang.StringLIST_SUFFIXprivate static java.lang.StringMAP_SUFFIX
-
Constructor Summary
Constructors Modifier Constructor Description privateMessageLiteToString()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidindent(int indent, java.lang.StringBuilder buffer)private static booleanisDefaultValue(java.lang.Object o)private static java.lang.StringpascalCaseToSnakeCase(java.lang.String pascalCase)(package private) static voidprintField(java.lang.StringBuilder buffer, int indent, java.lang.String name, java.lang.Object object)Formats a text proto field.private static voidreflectivePrintWithIndent(MessageLite messageLite, java.lang.StringBuilder buffer, int indent)Reflectively prints theMessageLiteto the buffer at givenindentlevel.(package private) static java.lang.StringtoString(MessageLite messageLite, java.lang.String commentString)Returns aStringrepresentation of theMessageLiteobject.
-
-
-
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 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, java.lang.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
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)
-
-