Package com.google.protobuf
Class ProtobufToStringOutput
- java.lang.Object
-
- com.google.protobuf.ProtobufToStringOutput
-
public final class ProtobufToStringOutput extends java.lang.Object
ProtobufToStringOutput controls the output format ofMessage.toString()
. Specifically, for the Runnable object passed to `callWithDebugFormat` and `callWithTextFormat`, Message.toString() will always output the specified format unless ProtobufToStringOutput is used again to change the output format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ProtobufToStringOutput.OutputMode
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<ProtobufToStringOutput.OutputMode>
outputMode
-
Constructor Summary
Constructors Modifier Constructor Description private
ProtobufToStringOutput()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
callWithDebugFormat(java.lang.Runnable impl)
private static void
callWithSpecificFormat(java.lang.Runnable impl, ProtobufToStringOutput.OutputMode mode)
static void
callWithTextFormat(java.lang.Runnable impl)
private static ProtobufToStringOutput.OutputMode
setOutputMode(ProtobufToStringOutput.OutputMode newMode)
static boolean
shouldOutputDebugFormat()
-
-
-
Field Detail
-
outputMode
private static final java.lang.ThreadLocal<ProtobufToStringOutput.OutputMode> outputMode
-
-
Method Detail
-
setOutputMode
@CanIgnoreReturnValue private static ProtobufToStringOutput.OutputMode setOutputMode(ProtobufToStringOutput.OutputMode newMode)
-
callWithSpecificFormat
private static void callWithSpecificFormat(java.lang.Runnable impl, ProtobufToStringOutput.OutputMode mode)
-
callWithDebugFormat
public static void callWithDebugFormat(java.lang.Runnable impl)
-
callWithTextFormat
public static void callWithTextFormat(java.lang.Runnable impl)
-
shouldOutputDebugFormat
public static boolean shouldOutputDebugFormat()
-
-