/** * Returns the {@link Type} of this tuple. It will never be a {@link Type#RECORD_TUPLE} or a * {@link Type#UNKNOWN_TUPLE}. See {@link #classify(Tuple)} for full classification. * * @param tuple The tuple whose type is needed. * @return An {@link Optional} {@link Type} for the tuple. */ public Optional<Type> classifyInternalTypes(Tuple tuple) { return INTERNAL_TYPES.stream().filter(x -> x.isMe(tuple)).findFirst(); } }
public static Tuple makeTuple(Type type, Object... contents) { return makeRawTuple(type.getComponent(), type.getStream(), contents); }
/** * Returns true iff the given tuple is of this Type. * * @param tuple The tuple to check for. * @return A boolean denoting whether this tuple is of this Type. */ public boolean isMe(Tuple tuple) { return isEqualIfSet(component, tuple.getSourceComponent()) && isEqualIfSet(stream, tuple.getSourceStreamId()); }
/** * Returns the {@link Type} of this tuple. It will never be a {@link Type#RECORD_TUPLE} or a * {@link Type#UNKNOWN_TUPLE}. See {@link #classify(Tuple)} for full classification. * * @param tuple The tuple whose type is needed. * @return An {@link Optional} {@link Type} for the tuple. */ public Optional<Type> classifyInternalTypes(Tuple tuple) { return INTERNAL_TYPES.stream().filter(x -> x.isMe(tuple)).findFirst(); } }
/** * Returns true iff the given tuple is of this Type. * * @param tuple The tuple to check for. * @return A boolean denoting whether this tuple is of this Type. */ public boolean isMe(Tuple tuple) { return isEqualIfSet(component, tuple.getSourceComponent()) && isEqualIfSet(stream, tuple.getSourceStreamId()); }