本文整理了Java中com.google.protobuf.Any.getDescriptor()
方法的一些代码示例,展示了Any.getDescriptor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Any.getDescriptor()
方法的具体详情如下:
包路径:com.google.protobuf.Any
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!