Package com.google.protobuf
Class MapFieldBuilder<KeyT,MessageOrBuilderT extends MessageOrBuilder,MessageT extends MessageOrBuilderT,BuilderT extends MessageOrBuilderT>
- java.lang.Object
-
- com.google.protobuf.MapFieldReflectionAccessor
-
- com.google.protobuf.MapFieldBuilder<KeyT,MessageOrBuilderT,MessageT,BuilderT>
-
public class MapFieldBuilder<KeyT,MessageOrBuilderT extends MessageOrBuilder,MessageT extends MessageOrBuilderT,BuilderT extends MessageOrBuilderT> extends MapFieldReflectionAccessor
Internal representation of map fields in generated builders.This class supports accessing the map field as a
Map
to be used in generated API and also supports accessing the field as aList
to be used in reflection API. It keeps track of where the data is currently stored and do necessary conversions between map and list.This class is a protobuf implementation detail. Users shouldn't use this class directly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MapFieldBuilder.Converter<KeyT,MessageOrBuilderT extends MessageOrBuilder,MessageT extends MessageOrBuilderT>
Convert a MessageOrBuilder to a Message regardless of which it holds.
-
Constructor Summary
Constructors Constructor Description MapFieldBuilder(MapFieldBuilder.Converter<KeyT,MessageOrBuilderT,MessageT> converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapField<KeyT,MessageT>
build(MapEntry<KeyT,MessageT> defaultEntry)
Converts this MapFieldBuilder to a MapField.void
clear()
MapFieldBuilder<KeyT,MessageOrBuilderT,MessageT,BuilderT>
copy()
Returns a deep copy of this MapFieldBuilder.java.util.Map<KeyT,MessageOrBuilderT>
ensureBuilderMap()
java.util.List<Message>
ensureMessageList()
java.util.Map<KeyT,MessageT>
ensureMessageMap()
boolean
equals(java.lang.Object object)
java.util.Map<KeyT,MessageT>
getImmutableMap()
int
hashCode()
void
mergeFrom(MapField<KeyT,MessageT> other)
-
-
-
Constructor Detail
-
MapFieldBuilder
public MapFieldBuilder(MapFieldBuilder.Converter<KeyT,MessageOrBuilderT,MessageT> converter)
-
-
Method Detail
-
ensureBuilderMap
public java.util.Map<KeyT,MessageOrBuilderT> ensureBuilderMap()
-
ensureMessageList
public java.util.List<Message> ensureMessageList()
-
clear
public void clear()
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
copy
public MapFieldBuilder<KeyT,MessageOrBuilderT,MessageT,BuilderT> copy()
Returns a deep copy of this MapFieldBuilder.
-
-