Class Structs (2.32.0)

publicfinalclassStructs

This class contains static utility methods that operate on or return protobuf'sStruct objects. This is considered an internal class and implementation detail.

Static Methods

asMap(Struct struct)

publicstaticMap<String,Object>asMap(Structstruct)

Returns an unmodifiable map view of theStruct parameter.

Parameter
NameDescription
structStruct
Returns
TypeDescription
Map<String,Object>

newStruct(Map<String,?> map)

publicstaticStructnewStruct(Map<String,?>map)

Creates a newStruct object given the content of the providedmap parameter.

Notice that all numbers (int, long, float and double) are serialized as double values. Enums are serialized as strings.

Parameter
NameDescription
mapMap<String,?>
Returns
TypeDescription
Struct

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-31 UTC.