本文整理汇总了Java中cascading.tuple.type.CoercibleType类的典型用法代码示例。如果您正苦于以下问题:Java CoercibleType类的具体用法?Java CoercibleType怎么用?Java CoercibleType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CoercibleType类属于cascading.tuple.type包,在下文中一共展示了CoercibleType类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: coerceToString
import cascading.tuple.type.CoercibleType; //导入依赖的package包/类
static Tuple coerceToString(SinkCall<?, ?> sinkCall) {
TupleEntry entry = sinkCall.getOutgoingEntry();
Fields fields = entry.getFields();
Tuple tuple = entry.getTuple();
if (fields.hasTypes()) {
Type types[] = new Type[fields.size()];
for (int index = 0; index < fields.size(); index++) {
Type type = fields.getType(index);
if (type instanceof CoercibleType<?>) {
types[index] = String.class;
}
else {
types[index] = type;
}
}
tuple = entry.getCoercedTuple(types);
}
return tuple;
}
示例2: setObject
import cascading.tuple.type.CoercibleType; //导入依赖的package包/类
static void setObject(TupleEntry entry, Comparable<?> field, Object object) {
if (object != null && entry.getFields().getType(field) instanceof CoercibleType) {
entry.setObject(field, object.toString());
}
else {
entry.setObject(field, object);
}
}
示例3: flushTupleEntry
import cascading.tuple.type.CoercibleType; //导入依赖的package包/类
private void flushTupleEntry() {
if (tupleEntry != null) {
if (types != null) {
CoercibleType<?>[] coercions = Coercions.coercibleArray(types.length, types);
Object[] values = Tuples.asArray(tupleEntry.selectTuple(fields), coercions, types, new Object[types.length]);
tupleEntry.setTuple(new Tuple(values));
}
list.add(tupleEntry.getTuple());
}
}