com.google.protobuf.GeneratedMessageV3类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(1928)

本文整理了Java中com.google.protobuf.GeneratedMessageV3类的一些代码示例,展示了GeneratedMessageV3类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeneratedMessageV3类的具体详情如下:
包路径:com.google.protobuf.GeneratedMessageV3
类名称:GeneratedMessageV3

GeneratedMessageV3介绍

[英]All generated protocol message classes extend this class. This class implements most of the Message and Builder interfaces using Java reflection. Users can ignore this class and pretend that generated messages implement the Message interface directly.
[中]所有生成的协议消息类都扩展了该类。此类使用Java反射实现大多数消息和生成器接口。用户可以忽略这个类,并假装生成的消息直接实现了消息接口。

代码示例

代码示例来源:origin: Alluxio/alluxio

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

代码示例来源:origin: alibaba/canal

public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseDelimitedFrom(
  java.io.InputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 return com.google.protobuf.GeneratedMessageV3
   .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.alibaba.otter.canal.protocol.CanalPacket.Ack parseFrom(

代码示例来源:origin: alibaba/canal

public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseFrom(
  java.io.InputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 return com.google.protobuf.GeneratedMessageV3
   .parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.alibaba.otter.canal.protocol.CanalPacket.Packet parseDelimitedFrom(java.io.InputStream input)

代码示例来源:origin: apache/incubator-shardingsphere

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (!name_.isEmpty()) {
  output.writeBytes(1, name_);
 }
 if (!password_.isEmpty()) {
  output.writeBytes(2, password_);
 }
 for (int i = 0; i < roles_.size(); i++) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 3, roles_.getRaw(i));
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (!getDestinationBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_);
 }
 if (!getClientIdBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_);
 }
 if (batchId_ != 0L) {
  output.writeInt64(3, batchId_);
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: googleapis/google-cloud-java

@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
 if (!getNameBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
 }
 if (!getSubscriptionBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subscription_);
 }
 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
   output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 3);
 unknownFields.writeTo(output);
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (communicationEncodingPresentCase_ == 1) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, communicationEncodingPresent_);
 }
 if (!seeds_.isEmpty()) {
  output.writeBytes(2, seeds_);
 }
 if (supportedCompressions_ != com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2.getNumber()) {
  output.writeEnum(3, supportedCompressions_);
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (communicationEncodingPresentCase_ == 1) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, communicationEncodingPresent_);
 }
 if (!seeds_.isEmpty()) {
  size += com.google.protobuf.CodedOutputStream
   .computeBytesSize(2, seeds_);
 }
 if (supportedCompressions_ != com.alibaba.otter.canal.protocol.CanalPacket.Compression.COMPRESSIONCOMPATIBLEPROTO2.getNumber()) {
  size += com.google.protobuf.CodedOutputStream
   .computeEnumSize(3, supportedCompressions_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源:origin: google/error-prone

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (!getClassNameBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, className_);
 }
 for (int i = 0; i < member_.size(); i++) {
  output.writeMessage(2, member_.get(i));
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: google/error-prone

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (!getClassNameBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, className_);
 }
 for (int i = 0; i < member_.size(); i++) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(2, member_.get(i));
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (errorCodePresentCase_ == 1) {
  output.writeInt32(
    1, (int)((java.lang.Integer) errorCodePresent_));
 }
 if (!getErrorMessageBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_);
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (errorCodePresentCase_ == 1) {
  size += com.google.protobuf.CodedOutputStream
   .computeInt32Size(
     1, (int)((java.lang.Integer) errorCodePresent_));
 }
 if (!getErrorMessageBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (!getDestinationBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_);
 }
 if (!getClientIdBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clientId_);
 }
 if (batchId_ != 0L) {
  size += com.google.protobuf.CodedOutputStream
   .computeInt64Size(3, batchId_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源:origin: alibaba/canal

@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (!getDestinationBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_);
 }
 if (!getClientIdBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_);
 }
 if (!getFilterBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_);
 }
 unknownFields.writeTo(output);
}

代码示例来源:origin: Alluxio/alluxio

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 for (int i = 0; i < metrics_.size(); i++) {
  output.writeMessage(1, metrics_.get(i));
 }
 com.google.protobuf.GeneratedMessageV3
  .serializeStringMapTo(
   output,
   internalGetCapacityBytesOnTiers(),
   CapacityBytesOnTiersDefaultEntryHolder.defaultEntry,
   2);
 unknownFields.writeTo(output);
}

代码示例来源:origin: Alluxio/alluxio

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 com.google.protobuf.GeneratedMessageV3
  .serializeStringMapTo(
   output,
   internalGetMountPoints(),
   MountPointsDefaultEntryHolder.defaultEntry,
   1);
 unknownFields.writeTo(output);
}

代码示例来源:origin: weibocom/motan

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (location_ != null) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(1, getLocation());
 }
 if (!getMessageBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_);
 }
 memoizedSize = size;
 return size;
}

代码示例来源:origin: weibocom/motan

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (location_ != null) {
  output.writeMessage(1, getLocation());
 }
 if (!getMessageBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_);
 }
}

代码示例来源:origin: google/error-prone

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (!getClassNameBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, className_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源:origin: Alluxio/alluxio

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (((bitField0_ & 0x00000001) == 0x00000001)) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, path_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

相关文章