Package com.google.protobuf
Class UnredactedDebugFormatForTest
java.lang.Object
com.google.protobuf.UnredactedDebugFormatForTest
These APIs are restricted to test-only targets, and are suitable for test purposes where it is
impractical to compare protos directly via ProtoTruth (e.g. log output).
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
LikeTextFormat.printer().printToString(message)
, but for test assertion purposes.static String
LikeTextFormat.printer().printToString(fields)
, but for test assertion purposes.static String
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for test assertion purposes.static String
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for test assertion purposes.static String
unredactedStringValueOf
(Object object) Return String.valueOf() with the guarantee that any Protobuf Message.toString() invoked under this call always returns TextFormat (except for Message.toString() calls that are also under ProtobufToStringOutput.callWithDebugFormat).static String
unredactedToString
(Object object) Return object.toString() with the guarantee that any Protobuf Message.toString() invoked under this call always returns TextFormat (except for Message.toString() calls that are also under ProtobufToStringOutput.callWithDebugFormat).
-
Method Details
-
unredactedMultilineString
LikeTextFormat.printer().printToString(message)
, but for test assertion purposes. -
unredactedMultilineString
LikeTextFormat.printer().printToString(fields)
, but for test assertion purposes. -
unredactedSingleLineString
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for test assertion purposes. -
unredactedSingleLineString
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for test assertion purposes. -
unredactedToString
Return object.toString() with the guarantee that any Protobuf Message.toString() invoked under this call always returns TextFormat (except for Message.toString() calls that are also under ProtobufToStringOutput.callWithDebugFormat). This is particularly useful for toString calls on objects that contain Protobuf messages (e.g collections) and existing code expects toString() on these objects to contain Message.toString() outputs in TextFormat. -
unredactedStringValueOf
Return String.valueOf() with the guarantee that any Protobuf Message.toString() invoked under this call always returns TextFormat (except for Message.toString() calls that are also under ProtobufToStringOutput.callWithDebugFormat). This is particularly useful for explicit and implicit String.valueOf() calls on objects that contain Protobuf messages (e.g collections) and may be null, and existing code expects toString() on these objects to contain Message.toString() outputs in TextFormat.
-