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).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringLikeTextFormat.printer().printToString(message), but for legacy purposes.static StringLikeTextFormat.printer().printToString(fields), but for legacy purposes.static StringLikeTextFormat.printer().emittingSingleLine(true).printToString(message), but for legacy purposes.static StringLikeTextFormat.printer().emittingSingleLine(true).printToString(fields), but for legacy purposes.static StringlegacyUnredactedStringFormat(String format, Object... args) Return String.format() 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 StringlegacyUnredactedStringValueOf(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 StringlegacyUnredactedToString(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[]legacyUnredactedToStringArray(Object[] objects) Deprecated.legacyUnredactedToStringList(Iterable<?> iterable) Deprecated.
-
Constructor Details
-
LegacyUnredactedTextFormat
private LegacyUnredactedTextFormat()
-
-
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. -
legacyUnredactedToStringList
Deprecated.Map each element in anIterable<T>toIterable<String>using legacyUnredactedStringValueOf. This is a useful shortcut for callers that operate on an Iterable of objects. -
legacyUnredactedToStringArray
Deprecated.Map each element in an Object[] to String using legacyUnredactedStringValueOf. This is a useful shortcut for callers that operate on an Object[] of objects. -
legacyUnredactedStringFormat
Return String.format() 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 useful for refactoring String.format() calls when 1) the objects being interpolated are Protobuf messages or contain Protobuf messages, and 2) the existing code expects toString() on the interpolated objects to output the text format.
-