Class MessageLiteToString

java.lang.Object
com.google.protobuf.MessageLiteToString

final class MessageLiteToString extends Object
Helps generate String representations of MessageLite protos.
  • Field Details

  • Constructor Details

    • MessageLiteToString

      MessageLiteToString()
  • Method Details

    • toString

      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.

    • reflectivePrintWithIndent

      private static void reflectivePrintWithIndent(MessageLite messageLite, StringBuilder buffer, int indent)
      Reflectively prints the MessageLite to the buffer at given indent level.
      Parameters:
      buffer - the buffer to write to
      indent - the number of spaces to indent the proto by
    • isDefaultValue

      private static boolean isDefaultValue(Object o)
    • printField

      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 - the buffer to write to
      indent - the number of spaces the proto should be indented by
      name - the field name (in lower underscore case)
      object - the object value of the field
    • camelCaseToSnakeCase

      private static final String camelCaseToSnakeCase(String camelCase)