Top Description Fields Constructors Methods
com.google.protobuf

pack-priv final Class MessageLiteToString

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, .Modifier, java.util.HashMap, .Iterator, .List, .Map, .Set, .TreeSet

Helps generate String representations of MessageLite protos.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static final String
private static boolean
pack-priv static final void
printField(StringBuilder
the buffer to write to
buffer
,
int
the number of spaces the proto should be indented by
indent
,
String
the field name (in lower underscore case)
name
,
Object
the object value of the field
object
)

Formats a text proto field.

private static void
reflectivePrintWithIndent(MessageLite messageLite, StringBuilder
the buffer to write to
buffer
,
int
the number of spaces to indent the proto by
indent
)

Reflectively prints the MessageLite to the buffer at given indent level.

pack-priv static String
toString(MessageLite messageLite, String commentString)

Returns a String representation of the MessageLite object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUILDER_LIST_SUFFIXback to summary
private static final String BUILDER_LIST_SUFFIX
BYTES_SUFFIXback to summary
private static final String BYTES_SUFFIX
LIST_SUFFIXback to summary
private static final String LIST_SUFFIX
MAP_SUFFIXback to summary
private static final String MAP_SUFFIX

Constructor Detail

MessageLiteToStringback to summary
pack-priv MessageLiteToString()

Method Detail

camelCaseToSnakeCaseback to summary
private static final String camelCaseToSnakeCase(String camelCase)
isDefaultValueback to summary
private static boolean isDefaultValue(Object o)
printFieldback to summary
pack-priv static final void printField(StringBuilder buffer, int indent, String name, Object object)

Formats a text proto field.

For use by generated code only.

Parameters
buffer:StringBuilder

the buffer to write to

indent:int

the number of spaces the proto should be indented by

name:String

the field name (in lower underscore case)

object:Object

the object value of the field

reflectivePrintWithIndentback to summary
private static void reflectivePrintWithIndent(MessageLite messageLite, StringBuilder buffer, int indent)

Reflectively prints the MessageLite to the buffer at given indent level.

Parameters
buffer:StringBuilder

the buffer to write to

indent:int

the number of spaces to indent the proto by

toStringback to summary
pack-priv static String toString(MessageLite messageLite, String commentString)

Returns a String representation of the MessageLite object. The first line of the String 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.