org.apache.avro.reflect.Union类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(135)

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

Union介绍

暂无

代码示例

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

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

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

public static class R9_1  {
 @Union({Void.class, R7.class, R8.class})
 public Object value;
 @Override
 public boolean equals(Object o) {
  if (!(o instanceof R9_1)) return false;
  if (this.value == null) return ((R9_1)o).value == null;
  return this.value.equals(((R9_1)o).value);
 }
}

代码示例来源:origin: org.apache.avro/avro

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

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

@Union({Void.class,String.class})
  String foo(@Union({Void.class,String.class}) String s);
}

代码示例来源:origin: FasterXML/jackson-dataformats-binary

protected Class<?>[] _getUnionTypes(Annotated a) {
    Union ann = _findAnnotation(a, Union.class);
    if (ann != null) {
      // 14-Apr-2017, tatu: I think it makes sense to require non-empty List, as this allows
      //   disabling annotation with overrides. But one could even consider requiring more than
      //   one (where single type is not really polymorphism)... for now, however, just one
      //   is acceptable, and maybe that has valid usages.
      Class<?>[] c = ann.value();
      if (c.length > 0) {
        return c;
      }
    }
    return null;
  }
}

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

@Union({R7.class, R8.class})
public static class R6 {}

代码示例来源:origin: org.apache.hadoop/avro

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

代码示例来源:origin: iflytek/Guitar

@Union({SumFormat.class, MaxFormat.class, MinFormat.class, AvgFormat.class, ValueDistFormat.class, RangeDistFormat.class, UVBitmapFormat.class, HyperLogLogFormat.class, HyperLogLogPlusFormat.class})
public abstract class AnalysisFormat extends ObjectValue {

代码示例来源:origin: org.apache.cassandra.deps/avro

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

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

@Union({UnionCase1.class, UnionCase2.class})
private abstract static class DeterministicUnionBase {}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.avro

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

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

@Union({UnionCase1.class, UnionCase2.class, UnionCase3.class})
private abstract static class NonDeterministicUnionBase {}

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

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private Schema getAnnotatedUnion(Union union, Map<String,Schema> names) {
 List<Schema> branches = new ArrayList<Schema>();
 for (Class branch : union.value())
  branches.add(createSchema(branch, names));
 return Schema.createUnion(branches);
}

相关文章

微信公众号

最新文章

更多