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

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

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

Any.getDescriptor介绍

暂无

代码示例

代码示例来源:origin: com.google.protobuf/protobuf-java

@java.lang.Override
public int hashCode() {
 if (memoizedHashCode != 0) {
  return memoizedHashCode;
 }
 int hash = 41;
 hash = (19 * hash) + getDescriptor().hashCode();
 hash = (37 * hash) + TYPE_URL_FIELD_NUMBER;
 hash = (53 * hash) + getTypeUrl().hashCode();
 hash = (37 * hash) + VALUE_FIELD_NUMBER;
 hash = (53 * hash) + getValue().hashCode();
 hash = (29 * hash) + unknownFields.hashCode();
 memoizedHashCode = hash;
 return hash;
}

代码示例来源:origin: com.google.protobuf/protobuf-java-util

Any.getDescriptor().getFullName(),
new WellKnownTypePrinter() {
 @Override

代码示例来源:origin: io.netifi.proteus/tracing-openzipkin

Any.getDescriptor().getFullName(),
new WellKnownTypePrinter() {
  @Override

代码示例来源:origin: netifi-proteus/proteus-java

Any.getDescriptor().getFullName(),
new WellKnownTypeParser() {
 @Override

代码示例来源:origin: netifi-proteus/proteus-java

Any.getDescriptor().getFullName(),
new WellKnownTypePrinter() {
 @Override

代码示例来源:origin: io.netifi.proteus/tracing-openzipkin

Any.getDescriptor().getFullName(),
new WellKnownTypeParser() {
  @Override

代码示例来源:origin: io.netifi.proteus/proteus-tracing-openzipkin

Any.getDescriptor().getFullName(),
new WellKnownTypePrinter() {
 @Override

代码示例来源:origin: com.google.protobuf/protobuf-java-util

Any.getDescriptor().getFullName(),
new WellKnownTypeParser() {
 @Override

代码示例来源:origin: io.netifi.proteus/proteus-tracing-openzipkin

Any.getDescriptor().getFullName(),
new WellKnownTypeParser() {
 @Override

代码示例来源:origin: googleapis/api-compiler

/**
 * Attempt to unpack if its an any instance. Returns null if not unpacked.
 */
@Nullable private Message maybeUnpackAnyType(FieldDescriptor field, Object value) {
 if (field.getType() == FieldDescriptor.Type.MESSAGE
   && field.getMessageType().getFullName().equals(Any.getDescriptor().getFullName())) {
  Any any = (Any) value;
  Message defaultInstance = anyConverterRegistry.get(any.getTypeUrl());
  if (defaultInstance != null) {
   try {
    return defaultInstance.toBuilder().mergeFrom(any.getValue()).build();
   } catch (InvalidProtocolBufferException e) {
    throw new RuntimeException(e);
   }
  }
 }
 return null;
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-extensions-protobuf

@Test
public void testAnyIsNotProto2() {
 // Any is a core Protocol Buffers type that uses proto3 syntax.
 thrown.expect(IllegalArgumentException.class);
 thrown.expectMessage(Any.class.getCanonicalName());
 thrown.expectMessage("in file " + Any.getDescriptor().getFile().getName());
 checkProto2Syntax(Any.class, ExtensionRegistry.getEmptyRegistry());
}

相关文章