本文整理了Java中org.apache.beam.sdk.values.TypeDescriptor.isSupertypeOf()
方法的一些代码示例,展示了TypeDescriptor.isSupertypeOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TypeDescriptor.isSupertypeOf()
方法的具体详情如下:
包路径:org.apache.beam.sdk.values.TypeDescriptor
类名称:TypeDescriptor
方法名:isSupertypeOf
[英]Returns true if this type is assignable from the given type.
[中]如果此类型可从给定类型赋值,则返回true。
代码示例来源:origin: org.apache.beam/beam-sdks-java-core
@SuppressWarnings("unchecked")
public static <T extends Serializable> SerializableCoder<T> of(TypeDescriptor<T> recordType) {
checkArgument(recordType.isSupertypeOf(new TypeDescriptor<CustomRecord>() {}));
return (SerializableCoder<T>) new CustomSerializableCoder();
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-core
private static void validateWindowTypeForMethod(
TypeDescriptor<? extends BoundedWindow> actualWindowT,
MethodWithExtraParameters methodSignature) {
if (methodSignature.windowT() != null) {
checkArgument(
methodSignature.windowT().isSupertypeOf(actualWindowT),
"%s unable to provide window -- expected window type from parameter (%s) is not a "
+ "supertype of actual window type assigned by windowing (%s)",
methodSignature.targetMethod(),
methodSignature.windowT(),
actualWindowT);
}
}
内容来源于网络,如有侵权,请联系作者删除!