congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MapField
Code IndexAdd Tabnine 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
  • InvalidProtocolBufferException
  • CodedInputStream
  • ByteString
origin: Graylog2/graylog2-server

/**
 * <pre>
 * all applicable templates that are referenced by the packets
 * </pre>
 *
 * <code>map&lt;uint32, bytes&gt; templates = 1;</code>
 */
public boolean containsTemplates(
  int key) {
 
 return internalGetTemplates().getMap().containsKey(key);
}
/**
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>
internalGetOptionTemplate() {
 if (optionTemplate_ == null) {
  return com.google.protobuf.MapField.emptyMapField(
    OptionTemplateDefaultEntryHolder.defaultEntry);
 }
 return optionTemplate_;
}
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 (!getImageVersionBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, imageVersion_);
 }
 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__);
 }
 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>
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.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

  • Start an intent from android
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now