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).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringLikeTextFormat.printer().printToString(message), but for test assertion purposes.static StringLikeTextFormat.printer().printToString(fields), but for test assertion purposes.static StringLikeTextFormat.printer().emittingSingleLine(true).printToString(message), but for test assertion purposes.static StringLikeTextFormat.printer().emittingSingleLine(true).printToString(fields), but for test assertion purposes.static StringunredactedStringValueOf(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 StringunredactedToString(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).static String[]unredactedToStringArray(Object[] objects) Map each element in an Object[] to String using unredactedStringValueOf.unredactedToStringList(Iterable<?> iterable) Map each element in anIterable<T>toIterable<String>using unredactedStringValueOf.
-
Constructor Details
-
UnredactedDebugFormatForTest
private UnredactedDebugFormatForTest()
-
-
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. -
unredactedToStringList
-
unredactedToStringArray
-