com.google.protobuf.ByteString.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(678)

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

ByteString.isEmpty介绍

[英]Returns true if the size is 0, false otherwise.
[中]如果大小为0,则返回true,否则返回false。

代码示例

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

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

代码示例来源: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: apache/incubator-shardingsphere

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

代码示例来源: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: apache/pulsar

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (instance_ != null) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(1, getInstance());
 }
 if (!getWorkerIdBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, workerId_);
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

代码示例来源: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: apache/pulsar

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (instance_ != null) {
  output.writeMessage(1, getInstance());
 }
 if (!getWorkerIdBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 2, workerId_);
 }
 unknownFields.writeTo(output);
}

代码示例来源: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: vert-x3/vertx-examples

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

代码示例来源: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: 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: 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 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: apache/pulsar

public int getSerializedSize() {
 int size = memoizedSize;
 if (size != -1) return size;
 size = 0;
 if (!getNameBytes().isEmpty()) {
  size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
 }
 if (instanceId_ != 0) {
  size += com.google.protobuf.CodedOutputStream
   .computeInt32Size(2, instanceId_);
 }
 if (metricsData_ != null) {
  size += com.google.protobuf.CodedOutputStream
   .computeMessageSize(3, getMetricsData());
 }
 size += unknownFields.getSerializedSize();
 memoizedSize = size;
 return size;
}

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

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

代码示例来源:origin: apache/pulsar

public void writeTo(com.google.protobuf.CodedOutputStream output)
          throws java.io.IOException {
 if (!getNameBytes().isEmpty()) {
  com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
 }
 if (instanceId_ != 0) {
  output.writeInt32(2, instanceId_);
 }
 if (metricsData_ != null) {
  output.writeMessage(3, getMetricsData());
 }
 unknownFields.writeTo(output);
}

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

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

代码示例来源:origin: vert-x3/vertx-examples

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

代码示例来源:origin: apache/pulsar

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

代码示例来源:origin: apache/pulsar

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

相关文章