Class Struct.Builder (3.19.4)

public static final class Struct.Builder extends GeneratedMessageLite.Builder<Struct,Struct.Builder> implements StructOrBuilder

Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for Struct is JSON object.

Protobuf type google.protobuf.Struct

Implements

StructOrBuilder

Methods

clearFields()

public Struct.Builder clearFields()
Returns
Type Description
Struct.Builder

containsFields(String key)

public boolean containsFields(String key)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameter
Name Description
key String
Returns
Type Description
boolean

getFields()

public Map<String,Value> getFields()

Use #getFieldsMap() instead.

Returns
Type Description
Map<String,Value>

getFieldsCount()

public int getFieldsCount()

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Returns
Type Description
int

getFieldsMap()

public Map<String,Value> getFieldsMap()

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Returns
Type Description
Map<String,Value>

getFieldsOrDefault(String key, Value defaultValue)

public Value getFieldsOrDefault(String key, Value defaultValue)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameters
Name Description
key String
defaultValue Value
Returns
Type Description
Value

getFieldsOrThrow(String key)

public Value getFieldsOrThrow(String key)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameter
Name Description
key String
Returns
Type Description
Value

putAllFields(Map<String,Value> values)

public Struct.Builder putAllFields(Map<String,Value> values)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameter
Name Description
values Map<String,Value>
Returns
Type Description
Struct.Builder

putFields(String key, Value value)

public Struct.Builder putFields(String key, Value value)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameters
Name Description
key String
value Value
Returns
Type Description
Struct.Builder

removeFields(String key)

public Struct.Builder removeFields(String key)

Unordered map of dynamically typed values.

map<string, .google.protobuf.Value> fields = 1;

Parameter
Name Description
key String
Returns
Type Description
Struct.Builder