org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(136)

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

ByteString.copyFromUtf8介绍

暂无

代码示例

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

static ByteString toByteString(String string) {
 return ByteString.copyFromUtf8(string);
}

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

/**
 * <code>string exceptionClassName = 1;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getExceptionClassNameBytes() {
 java.lang.Object ref = exceptionClassName_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  exceptionClassName_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string errorMsg = 2;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getErrorMsgBytes() {
 java.lang.Object ref = errorMsg_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  errorMsg_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string key_comparator_class = 7;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getKeyComparatorClassBytes() {
 java.lang.Object ref = keyComparatorClass_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  keyComparatorClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string errorMsg = 2;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getErrorMsgBytes() {
 java.lang.Object ref = errorMsg_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  errorMsg_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string key_class = 3;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getKeyClassBytes() {
 java.lang.Object ref = keyClass_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  keyClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string value_class = 4;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getValueClassBytes() {
 java.lang.Object ref = valueClass_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  valueClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string key_serde_class = 5;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getKeySerdeClassBytes() {
 java.lang.Object ref = keySerdeClass_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  keySerdeClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string exceptionClassName = 1;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getExceptionClassNameBytes() {
 java.lang.Object ref = exceptionClassName_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  exceptionClassName_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

代码示例来源:origin: hortonworks/ratis

/**
 * <code>string name = 1;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getNameBytes() {
 java.lang.Object ref = name_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  name_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

代码示例来源:origin: hortonworks/ratis

/**
 * <code>string exceptionClassName = 1;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getExceptionClassNameBytes() {
 java.lang.Object ref = exceptionClassName_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  exceptionClassName_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string name = 2;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getNameBytes() {
 java.lang.Object ref = name_;
 if (ref instanceof String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  name_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}
/**

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

/**
 * <code>string key_serde_class = 5;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getKeySerdeClassBytes() {
 java.lang.Object ref = keySerdeClass_;
 if (ref instanceof String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  keySerdeClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}
/**

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

/**
 * <code>string name = 2;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getNameBytes() {
 java.lang.Object ref = name_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  name_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string value_serde_class = 6;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getValueSerdeClassBytes() {
 java.lang.Object ref = valueSerdeClass_;
 if (ref instanceof java.lang.String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  valueSerdeClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}

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

/**
 * <code>string exceptionClassName = 1;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getExceptionClassNameBytes() {
 java.lang.Object ref = exceptionClassName_;
 if (ref instanceof String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  exceptionClassName_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}
/**

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

/**
 * <code>string key_class = 3;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getKeyClassBytes() {
 java.lang.Object ref = keyClass_;
 if (ref instanceof String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  keyClass_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}
/**

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

/**
 * <code>string errorMsg = 2;</code>
 */
public org.apache.ratis.thirdparty.com.google.protobuf.ByteString
  getErrorMsgBytes() {
 java.lang.Object ref = errorMsg_;
 if (ref instanceof String) {
  org.apache.ratis.thirdparty.com.google.protobuf.ByteString b = 
    org.apache.ratis.thirdparty.com.google.protobuf.ByteString.copyFromUtf8(
      (java.lang.String) ref);
  errorMsg_ = b;
  return b;
 } else {
  return (org.apache.ratis.thirdparty.com.google.protobuf.ByteString) ref;
 }
}
/**

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

static Message valueOf(String string) {
 return valueOf(ByteString.copyFromUtf8(string), () -> "Message:" + string);
}

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

@Override
public void run() throws Exception {
 RaftProperties raftProperties = new RaftProperties();
 final RaftGroup raftGroup = RaftGroup.valueOf(RaftGroupId.valueOf(ByteString.copyFromUtf8(raftGroupId)),
   parsePeers(peers));
 RaftClient.Builder builder =
   RaftClient.newBuilder().setProperties(raftProperties);
 builder.setRaftGroup(raftGroup);
 builder.setClientRpc(new GrpcFactory(new Parameters()).newRaftClientRpc(ClientId.randomId(), raftProperties));
 RaftClient client = builder.build();
 operation(client);
}

相关文章