Class Struct.Builder

  • All Implemented Interfaces:
    MessageLite.Builder, MessageLiteOrBuilder, StructOrBuilder, java.lang.Cloneable
    Enclosing class:
    Struct

    public static final class Struct.Builder
    extends GeneratedMessageLite.Builder<Struct,​Struct.Builder>
    implements StructOrBuilder
     Represents a JSON object.
    
     An unordered key-value map, intending to perfectly capture the semantics of a
     JSON object. This enables parsing any arbitrary JSON payload as a message
     field in ProtoJSON format.
    
     This follows RFC 8259 guidelines for interoperable JSON: notably this type
     cannot represent large Int64 values or `NaN`/`Infinity` numbers,
     since the JSON format generally does not support those values in its number
     type.
    
     If you do not intend to parse arbitrary JSON into your message, a custom
     typed message should be preferred instead of using this type.
     
    Protobuf type google.protobuf.Struct
    • Constructor Detail

      • Builder

        private Builder()
    • Method Detail

      • getFieldsCount

        public int getFieldsCount()
        Description copied from interface: StructOrBuilder
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
        Specified by:
        getFieldsCount in interface StructOrBuilder
      • containsFields

        public boolean containsFields​(java.lang.String key)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
        Specified by:
        containsFields in interface StructOrBuilder
      • removeFields

        public Struct.Builder removeFields​(java.lang.String key)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
      • getFieldsMap

        public java.util.Map<java.lang.String,​Value> getFieldsMap()
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
        Specified by:
        getFieldsMap in interface StructOrBuilder
      • getFieldsOrDefault

        public Value getFieldsOrDefault​(java.lang.String key,
                                        Value defaultValue)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
        Specified by:
        getFieldsOrDefault in interface StructOrBuilder
      • getFieldsOrThrow

        public Value getFieldsOrThrow​(java.lang.String key)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
        Specified by:
        getFieldsOrThrow in interface StructOrBuilder
      • putFields

        public Struct.Builder putFields​(java.lang.String key,
                                        Value value)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;
      • putAllFields

        public Struct.Builder putAllFields​(java.util.Map<java.lang.String,​Value> values)
         Unordered map of dynamically typed values.
         
        map<string, .google.protobuf.Value> fields = 1;