Codota Logo
MapField
Code IndexAdd Codota to your IDE (free)

How to use
MapField
in
com.google.protobuf

Best Java code snippets using com.google.protobuf.MapField (Showing top 20 results out of 909)

Refine searchRefine arrow

  • MapEntry
  • MapEntry.Builder
  • CodedOutputStream
  • CodedInputStream
  • InvalidProtocolBufferException
  • ByteString
  • Common ways to obtain MapField
private void myMethod () {
MapField m =
  • Codota IconMapEntry defaultEntry;MapField.newMapField(defaultEntry)
  • Codota IconMapEntry defaultEntry;MapField.emptyMapField(defaultEntry)
  • Smart code suggestions by Codota
}
origin: Graylog2/graylog2-server

/**
 * <pre>
 * there is only one option template, but we need to know its template id, so a map is the easiest way to find it
 * </pre>
 *
 * <code>map&lt;uint32, bytes&gt; optionTemplate = 2;</code>
 */
public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getOptionTemplateMap() {
 return internalGetOptionTemplate().getMap();
}
/**
origin: Graylog2/graylog2-server

/**
 * Use alternate mutation accessors instead.
 */
@java.lang.Deprecated
public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString>
getMutableTemplates() {
 return internalGetMutableTemplates().getMutableMap();
}
/**
origin: Graylog2/graylog2-server

private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
internalGetMutableOptionTemplate() {
 onChanged();;
 if (optionTemplate_ == null) {
  optionTemplate_ = com.google.protobuf.MapField.newMapField(
    OptionTemplateDefaultEntryHolder.defaultEntry);
 }
 if (!optionTemplate_.isMutable()) {
  optionTemplate_ = optionTemplate_.copy();
 }
 return optionTemplate_;
}
origin: Graylog2/graylog2-server

boolean done = false;
while (!done) {
 int tag = input.readTag();
 switch (tag) {
  case 0:
    templates_ = com.google.protobuf.MapField.newMapField(
      TemplatesDefaultEntryHolder.defaultEntry);
    mutable_bitField0_ |= 0x00000001;
   templates = input.readMessage(
     TemplatesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
   templates_.getMutableMap().put(templates.getKey(), templates.getValue());
   break;
    optionTemplate_ = com.google.protobuf.MapField.newMapField(
      OptionTemplateDefaultEntryHolder.defaultEntry);
    mutable_bitField0_ |= 0x00000002;
   optionTemplate = input.readMessage(
     OptionTemplateDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
   optionTemplate_.getMutableMap().put(optionTemplate.getKey(), optionTemplate.getValue());
   break;
origin: apache/geode

@java.lang.Override
public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
    : internalGetCredentials().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
  credentials__ = CredentialsDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  size += com.google.protobuf.CodedOutputStream
    .computeMessageSize(1, credentials__);
 }
 if (!getValueFormatBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, valueFormat_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}
origin: Alluxio/alluxio

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 for (java.util.Map.Entry<java.lang.String, alluxio.grpc.MetricValue> entry
    : internalGetMetrics().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.String, alluxio.grpc.MetricValue>
  metrics__ = MetricsDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  size += com.google.protobuf.CodedOutputStream
    .computeMessageSize(1, metrics__);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}
origin: Graylog2/graylog2-server

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 for (java.util.Map.Entry<java.lang.Integer, com.google.protobuf.ByteString> entry
    : internalGetTemplates().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.Integer, com.google.protobuf.ByteString>
  templates = TemplatesDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  output.writeMessage(1, templates);
 }
 for (java.util.Map.Entry<java.lang.Integer, com.google.protobuf.ByteString> entry
    : internalGetOptionTemplate().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.Integer, com.google.protobuf.ByteString>
  optionTemplate = OptionTemplateDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  output.writeMessage(2, optionTemplate);
 }
 for (int i = 0; i < packets_.size(); i++) {
  output.writeBytes(3, packets_.get(i));
 }
 unknownFields.writeTo(output);
}
origin: Alluxio/alluxio

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  size += com.google.protobuf.CodedOutputStream
   .computeBoolSize(1, readOnly_);
 }
 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
    : internalGetProperties().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
  properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  size += com.google.protobuf.CodedOutputStream
    .computeMessageSize(2, properties__);
 }
 if (((bitField0_ & 0x00000002) == 0x00000002)) {
  size += com.google.protobuf.CodedOutputStream
   .computeBoolSize(3, shared_);
 }
 if (((bitField0_ & 0x00000004) == 0x00000004)) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(4, getCommonOptions());
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}
origin: Graylog2/graylog2-server

public Builder clear() {
 super.clear();
 internalGetMutableTemplates().clear();
 internalGetMutableOptionTemplate().clear();
 packets_ = java.util.Collections.emptyList();
 bitField0_ = (bitField0_ & ~0x00000004);
 return this;
}
origin: Graylog2/graylog2-server

private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
internalGetTemplates() {
 if (templates_ == null) {
  return com.google.protobuf.MapField.emptyMapField(
    TemplatesDefaultEntryHolder.defaultEntry);
 }
 return templates_;
}
private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
origin: Alluxio/alluxio

public Builder mergeFrom(alluxio.grpc.GetMetricsPResponse other) {
 if (other == alluxio.grpc.GetMetricsPResponse.getDefaultInstance()) return this;
 internalGetMutableMetrics().mergeFrom(
   other.internalGetMetrics());
 this.mergeUnknownFields(other.unknownFields);
 onChanged();
 return this;
}
origin: Graylog2/graylog2-server

public org.graylog.plugins.netflow.v9.NetFlowV9Journal.RawNetflowV9 buildPartial() {
 org.graylog.plugins.netflow.v9.NetFlowV9Journal.RawNetflowV9 result = new org.graylog.plugins.netflow.v9.NetFlowV9Journal.RawNetflowV9(this);
 int from_bitField0_ = bitField0_;
 result.templates_ = internalGetTemplates();
 result.templates_.makeImmutable();
 result.optionTemplate_ = internalGetOptionTemplate();
 result.optionTemplate_.makeImmutable();
 if (((bitField0_ & 0x00000004) == 0x00000004)) {
  packets_ = java.util.Collections.unmodifiableList(packets_);
  bitField0_ = (bitField0_ & ~0x00000004);
 }
 result.packets_ = packets_;
 onBuilt();
 return result;
}
origin: Alluxio/alluxio

@java.lang.Override
public boolean equals(final java.lang.Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof alluxio.grpc.GetMetricsPResponse)) {
  return super.equals(obj);
 }
 alluxio.grpc.GetMetricsPResponse other = (alluxio.grpc.GetMetricsPResponse) obj;
 boolean result = true;
 result = result && internalGetMetrics().equals(
   other.internalGetMetrics());
 result = result && unknownFields.equals(other.unknownFields);
 return result;
}
origin: Alluxio/alluxio

 boolean done = false;
 while (!done) {
  int tag = input.readTag();
  switch (tag) {
   case 0:
     metrics_ = com.google.protobuf.MapField.newMapField(
       MetricsDefaultEntryHolder.defaultEntry);
     mutable_bitField0_ |= 0x00000001;
    metrics__ = input.readMessage(
      MetricsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
    metrics_.getMutableMap().put(
      metrics__.getKey(), metrics__.getValue());
    break;
 throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
 throw new com.google.protobuf.InvalidProtocolBufferException(
   e).setUnfinishedMessage(this);
} finally {
 this.unknownFields = unknownFields.build();
origin: googleapis/google-cloud-java

@java.lang.Override
public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (!getZoneBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, zone_);
 }
 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
   internalGetClusterLabels().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.String, java.lang.String> clusterLabels__ =
    ClusterLabelsDefaultEntryHolder.defaultEntry
      .newBuilderForType()
      .setKey(entry.getKey())
      .setValue(entry.getValue())
      .build();
  size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, clusterLabels__);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}
origin: Alluxio/alluxio

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 for (int i = 0; i < metrics_.size(); i++) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(1, metrics_.get(i));
 }
 for (java.util.Map.Entry<java.lang.String, java.lang.Long> entry
    : internalGetCapacityBytesOnTiers().getMap().entrySet()) {
  com.google.protobuf.MapEntry<java.lang.String, java.lang.Long>
  capacityBytesOnTiers__ = CapacityBytesOnTiersDefaultEntryHolder.defaultEntry.newBuilderForType()
    .setKey(entry.getKey())
    .setValue(entry.getValue())
    .build();
  size += com.google.protobuf.CodedOutputStream
    .computeMessageSize(2, capacityBytesOnTiers__);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}
origin: Alluxio/alluxio

public Builder clear() {
 super.clear();
 internalGetMutableMountPoints().clear();
 return this;
}
origin: Graylog2/graylog2-server

private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
internalGetOptionTemplate() {
 if (optionTemplate_ == null) {
  return com.google.protobuf.MapField.emptyMapField(
    OptionTemplateDefaultEntryHolder.defaultEntry);
 }
 return optionTemplate_;
}
origin: Alluxio/alluxio

public Builder mergeFrom(alluxio.grpc.GetMountTablePResponse other) {
 if (other == alluxio.grpc.GetMountTablePResponse.getDefaultInstance()) return this;
 internalGetMutableMountPoints().mergeFrom(
   other.internalGetMountPoints());
 this.mergeUnknownFields(other.unknownFields);
 onChanged();
 return this;
}
origin: Alluxio/alluxio

public alluxio.grpc.ConfigCheckReport buildPartial() {
 alluxio.grpc.ConfigCheckReport result = new alluxio.grpc.ConfigCheckReport(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
 result.errors_ = internalGetErrors();
 result.errors_.makeImmutable();
 result.warns_ = internalGetWarns();
 result.warns_.makeImmutable();
 if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  to_bitField0_ |= 0x00000001;
 }
 result.status_ = status_;
 result.bitField0_ = to_bitField0_;
 onBuilt();
 return result;
}
com.google.protobufMapField

Javadoc

Internal representation of map fields in generated messages. This class supports accessing the map field as a Map to be used in generated API and also supports accessing the field as a List 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. THREAD-SAFETY NOTE: Read-only access is thread-safe. Users can call getMap() and getList() concurrently in multiple threads. If write-access is needed, all access must be synchronized.

Most used methods

  • getMap
    Returns the content of this MapField as a read-only Map.
  • getMutableMap
    Gets a mutable Map view of this MapField.
  • isMutable
    Returns whether this field can be modified.
  • clear
  • copy
    Returns a deep copy of this MapField.
  • emptyMapField
    Returns an immutable empty MapField.
  • makeImmutable
    Makes this list immutable. All subsequent modifications will throw an UnsupportedOperationException.
  • mergeFrom
  • newMapField
    Creates a new mutable empty MapField.
  • equals
  • hashCode
  • <init>
  • hashCode,
  • <init>,
  • convertKeyAndValueToMessage,
  • convertListToMap,
  • convertMapToList,
  • convertMessageToKeyAndValue,
  • getList,
  • getMapEntryMessageDefaultInstance,
  • getMutableList

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now