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 java.lang.StringLIST_SUFFIXprivate static java.lang.StringMAP_SUFFIX
-
Constructor Summary
Constructors Constructor Description MessageLiteToString()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringcamelCaseToSnakeCase(java.lang.String camelCase)private static booleanisDefaultValue(java.lang.Object o)(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
-
-
Method Detail
-
toString
static java.lang.String toString(MessageLite messageLite, java.lang.String commentString)
Returns aStringrepresentation of theMessageLiteobject. The first line of theStringrepresentation 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 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 final 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 lower underscore case)object- the object value of the field
-
camelCaseToSnakeCase
private static final java.lang.String camelCaseToSnakeCase(java.lang.String camelCase)
-
-