Package com.google.protobuf
Class LegacyUnredactedTextFormat
- java.lang.Object
-
- com.google.protobuf.LegacyUnredactedTextFormat
-
public final class LegacyUnredactedTextFormat extends java.lang.Object
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
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
legacyUnredactedMultilineString(MessageOrBuilder message)
LikeTextFormat.printer().printToString(message)
, but for legacy purposes.static java.lang.String
legacyUnredactedMultilineString(UnknownFieldSet fields)
LikeTextFormat.printer().printToString(fields)
, but for legacy purposes.static java.lang.String
legacyUnredactedSingleLineString(MessageOrBuilder message)
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for legacy purposes.static java.lang.String
legacyUnredactedSingleLineString(UnknownFieldSet fields)
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for legacy purposes.static java.lang.String
legacyUnredactedStringFormat(java.lang.String format, java.lang.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 java.lang.String
legacyUnredactedStringValueOf(java.lang.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 java.lang.String
legacyUnredactedToString(java.lang.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 java.lang.String[]
legacyUnredactedToStringArray(java.lang.Object[] objects)
Deprecated.static java.lang.Iterable<java.lang.String>
legacyUnredactedToStringList(java.lang.Iterable<?> iterable)
Deprecated.
-
-
-
Method Detail
-
legacyUnredactedMultilineString
public static java.lang.String legacyUnredactedMultilineString(MessageOrBuilder message)
LikeTextFormat.printer().printToString(message)
, but for legacy purposes.
-
legacyUnredactedMultilineString
public static java.lang.String legacyUnredactedMultilineString(UnknownFieldSet fields)
LikeTextFormat.printer().printToString(fields)
, but for legacy purposes.
-
legacyUnredactedSingleLineString
public static java.lang.String legacyUnredactedSingleLineString(MessageOrBuilder message)
LikeTextFormat.printer().emittingSingleLine(true).printToString(message)
, but for legacy purposes.
-
legacyUnredactedSingleLineString
public static java.lang.String legacyUnredactedSingleLineString(UnknownFieldSet fields)
LikeTextFormat.printer().emittingSingleLine(true).printToString(fields)
, but for legacy purposes.
-
legacyUnredactedToString
public static java.lang.String legacyUnredactedToString(java.lang.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). 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
public static java.lang.String legacyUnredactedStringValueOf(java.lang.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). 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 public static java.lang.Iterable<java.lang.String> legacyUnredactedToStringList(java.lang.Iterable<?> iterable)
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 public static java.lang.String[] legacyUnredactedToStringArray(java.lang.Object[] objects)
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
public static java.lang.String legacyUnredactedStringFormat(java.lang.String format, java.lang.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). 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.
-
-