Utility classes to convert protobuf messages to/from JSON format. The JSON
format follows Proto3 JSON specification and only proto3 features are
supported. Proto2 only features (e.g., extensions and unknown fields) will
be discarded in the conversion. That is, when converting proto2 messages
to JSON format, extensions and unknown fields will be treated as if they
do not exist. This applies to proto2 messages embedded in proto3 messages
as well.
A TypeRegistry is used to resolve Any messages in the JSON conversion.
You must provide a TypeRegistry containing all message types used in
Any message fields, or the JSON conversion will fail because data
in Any message fields is unrecognizable. You don't need to supply a
TypeRegistry if you don't use Any message fields.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Package com.google.protobuf.util (3.19.4)\n\nClasses\n-------\n\n### [Durations](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Durations)\n\nUtilities to help create/manipulate `protobuf/duration.proto`. All operations throw an\nIllegalArgumentException if the input(s) are not [valid](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Durations#com_google_protobuf_util_Durations_isValid_com_google_protobuf_Duration_).\n\n### [FieldMaskUtil](/java/docs/reference/protobuf/latest/com.google.protobuf.util.FieldMaskUtil)\n\nUtility helper functions to work with [com.google.protobuf.FieldMask](/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask).\n\n### [FieldMaskUtil.MergeOptions](/java/docs/reference/protobuf/latest/com.google.protobuf.util.FieldMaskUtil.MergeOptions)\n\nOptions to customize merging behavior.\n\n### [JsonFormat](/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat)\n\nUtility classes to convert protobuf messages to/from JSON format. The JSON\nformat follows Proto3 JSON specification and only proto3 features are\nsupported. Proto2 only features (e.g., extensions and unknown fields) will\nbe discarded in the conversion. That is, when converting proto2 messages\nto JSON format, extensions and unknown fields will be treated as if they\ndo not exist. This applies to proto2 messages embedded in proto3 messages\nas well.\n\n### [JsonFormat.Parser](/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.Parser)\n\nA Parser parses JSON to protobuf message.\n\n### [JsonFormat.Printer](/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.Printer)\n\nA Printer converts protobuf message to JSON format.\n\n### [JsonFormat.TypeRegistry](/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.TypeRegistry)\n\nA TypeRegistry is used to resolve Any messages in the JSON conversion.\nYou must provide a TypeRegistry containing all message types used in\nAny message fields, or the JSON conversion will fail because data\nin Any message fields is unrecognizable. You don't need to supply a\nTypeRegistry if you don't use Any message fields.\n\n### [JsonFormat.TypeRegistry.Builder](/java/docs/reference/protobuf/latest/com.google.protobuf.util.JsonFormat.TypeRegistry.Builder)\n\nA Builder is used to build [TypeRegistry](/java/docs/reference/protobuf/latest/com.google.protobuf.TypeRegistry).\n\n### [Structs](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Structs)\n\nUtilities to help create `google.protobuf.Struct` messages.\n\n### [Timestamps](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Timestamps)\n\nUtilities to help create/manipulate `protobuf/timestamp.proto`. All operations throw an\nIllegalArgumentException if the input(s) are not [valid](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Timestamps#com_google_protobuf_util_Timestamps_isValid_com_google_protobuf_Timestamp_).\n\n### [Values](/java/docs/reference/protobuf/latest/com.google.protobuf.util.Values)\n\nUtilities to help create `google.protobuf.Value` messages."]]