Package com.google.protobuf
Class LegacyUnredactedTextFormat
java.lang.Object
com.google.protobuf.LegacyUnredactedTextFormat
The legacy APIs preserve the existing toString() behavior (output TextFormat), which allows us to
migrate toString callers that expect TextFormat output off toString. Eventually, we will make
toString output DebugFormat, which is randomized and redacts SPII fields (incompatible with
TextFormat).
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
LikeTextFormat.printer().printToString(message)
, but for legacy purposes.static String
LikeTextFormat.printer().printToString(fields)
, but for legacy purposes.static String
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for legacy purposes.static String
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for legacy purposes.static String
legacyUnredactedStringValueOf
(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
legacyUnredactedToString
(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
-
legacyUnredactedMultilineString
LikeTextFormat.printer().printToString(message)
, but for legacy purposes. -
legacyUnredactedMultilineString
LikeTextFormat.printer().printToString(fields)
, but for legacy purposes. -
legacyUnredactedSingleLineString
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for legacy purposes. -
legacyUnredactedSingleLineString
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for legacy purposes. -
legacyUnredactedToString
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. -
legacyUnredactedStringValueOf
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.
-