Package com.google.protobuf
Class MapEntry.Builder<K,V>
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<MapEntry.Builder<K,V>>
com.google.protobuf.MapEntry.Builder<K,V>
- All Implemented Interfaces:
Message.Builder,MessageLite.Builder,MessageLiteOrBuilder,MessageOrBuilder,Cloneable
Builder to create
MapEntry messages.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite.Builder
AbstractMessageLite.Builder.LimitedInputStream -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(Descriptors.FieldDescriptor field, Object value) LikesetRepeatedField, but appends the value as a new element.build()Constructs the message based on the state of the Builder.LikeMessageLite.Builder.build(), but does not throw an exception if the message is missing required fields.private voidClears the field.clearKey()clone()Clones the Builder.Returns a collection of all the fields in this message which are set and their corresponding values.Get an instance of the type with no fields set.Get the message's type's descriptor.Obtains the value of the given field, or the default value if it is not set.getKey()getRepeatedField(Descriptors.FieldDescriptor field, int index) Gets an element of a repeated field.intGets the number of elements of a repeated field.Get theUnknownFieldSetfor this message.getValue()booleanReturns true if the given field is set.booleanReturns true if all required fields in the message and all embedded messages are set, false otherwise.Create a builder for messages of the appropriate type for the given field.setField(Descriptors.FieldDescriptor field, Object value) Sets a field to the given value.setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) Sets an element of a repeated field to the given value.setUnknownFields(UnknownFieldSet unknownFields) Set theUnknownFieldSetfor this message.Methods inherited from class com.google.protobuf.AbstractMessage.Builder
clear, clearOneof, dispose, findInitializationErrors, getFieldBuilder, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedFieldBuilder, getUnknownFieldSetBuilder, hasOneof, internalMergeFrom, markClean, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeUnknownFields, newUninitializedMessageException, setUnknownFieldSetBuilder, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
-
Field Details
-
metadata
-
key
-
value
-
hasKey
private boolean hasKey -
hasValue
private boolean hasValue
-
-
Constructor Details
-
Builder
-
Builder
-
-
Method Details
-
getKey
-
getValue
-
setKey
-
clearKey
-
setValue
-
clearValue
-
build
Description copied from interface:MessageLite.BuilderConstructs the message based on the state of the Builder. Subsequent changes to the Builder will not affect the returned message. -
buildPartial
Description copied from interface:MessageLite.BuilderLikeMessageLite.Builder.build(), but does not throw an exception if the message is missing required fields. Instead, a partial message is returned. Subsequent changes to the Builder will not affect the returned message. -
getDescriptorForType
Description copied from interface:Message.BuilderGet the message's type's descriptor. SeeMessageOrBuilder.getDescriptorForType(). -
checkFieldDescriptor
-
newBuilderForField
Description copied from interface:Message.BuilderCreate a builder for messages of the appropriate type for the given field. The builder is NOT nested in the current builder. However, messages built with the builder can then be passed to theMessage.Builder.setField(Descriptors.FieldDescriptor, Object),Message.Builder.setRepeatedField(Descriptors.FieldDescriptor, int, Object), orMessage.Builder.addRepeatedField(Descriptors.FieldDescriptor, Object)method of the current builder.To obtain a builder nested in the current builder, use
Message.Builder.getFieldBuilder(Descriptors.FieldDescriptor)instead. -
setField
Description copied from interface:Message.BuilderSets a field to the given value. The value must be of the correct type for this field, that is, the same type thatMessageOrBuilder.getField(Descriptors.FieldDescriptor)returns. -
clearField
Description copied from interface:Message.BuilderClears the field. This is exactly equivalent to calling the generated "clear" accessor method corresponding to the field. -
setRepeatedField
public MapEntry.Builder<K,V> setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) Description copied from interface:Message.BuilderSets an element of a repeated field to the given value. The value must be of the correct type for this field; that is, the same type thatMessageOrBuilder.getRepeatedField(Descriptors.FieldDescriptor,int)returns. -
addRepeatedField
Description copied from interface:Message.BuilderLikesetRepeatedField, but appends the value as a new element. -
setUnknownFields
Description copied from interface:Message.BuilderSet theUnknownFieldSetfor this message. -
getDefaultInstanceForType
Description copied from interface:MessageLiteOrBuilderGet an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from thegetDefaultInstance()method of generated message classes in that this method is an abstract method of theMessageLiteinterface whereasgetDefaultInstance()is a static method of a specific class. They return the same thing. -
isInitialized
public boolean isInitialized()Description copied from interface:MessageLiteOrBuilderReturns true if all required fields in the message and all embedded messages are set, false otherwise. -
getAllFields
Description copied from interface:MessageOrBuilderReturns a collection of all the fields in this message which are set and their corresponding values. A singular ("required" or "optional") field is set iff hasField() returns true for that field. A "repeated" field is set iff getRepeatedFieldCount() is greater than zero. The values are exactly what would be returned by callingMessageOrBuilder.getField(Descriptors.FieldDescriptor)for each field. The map is guaranteed to be a sorted map, so iterating over it will return fields in order by field number.
If this is for a builder, the returned map may or may not reflect future changes to the builder. Either way, the returned map is itself unmodifiable. -
hasField
Description copied from interface:MessageOrBuilderReturns true if the given field is set. This is exactly equivalent to calling the generated "has" accessor method corresponding to the field. The return value of hasField() is semantically meaningful only for fields where field.hasPresence() == true. -
getField
Description copied from interface:MessageOrBuilderObtains the value of the given field, or the default value if it is not set. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned. For repeated fields, a java.util.List is returned. -
getRepeatedFieldCount
Description copied from interface:MessageOrBuilderGets the number of elements of a repeated field. This is exactly equivalent to calling the generated "Count" accessor method corresponding to the field. -
getRepeatedField
Description copied from interface:MessageOrBuilderGets an element of a repeated field. For primitive fields, the boxed primitive value is returned. For enum fields, the EnumValueDescriptor for the value is returned. For embedded message fields, the sub-message is returned. -
getUnknownFields
Description copied from interface:MessageOrBuilderGet theUnknownFieldSetfor this message. -
clone
Description copied from interface:MessageLite.BuilderClones the Builder.- Specified by:
clonein interfaceMessage.Builder- Specified by:
clonein interfaceMessageLite.Builder- Overrides:
clonein classAbstractMessage.Builder<MapEntry.Builder<K,V>> - See Also:
-