public class TupleTagList
extends java.lang.Object
implements java.io.Serializable
TupleTagList
is an immutable list of heterogeneously typed TupleTags
.
A TupleTagList
is used, for instance, to specify the tags of the additional outputs of a
ParDo
.
A TupleTagList
can be created and accessed like follows:
TupleTag<String> tag1 = ...;
TupleTag<Integer> tag2 = ...;
TupleTag<Iterable<String>> tag3 = ...;
// Create a TupleTagList with three TupleTags:
TupleTagList tags = TupleTagList.of(tag1).and(tag2).and(tag3);
// Create an empty TupleTagList:
Pipeline p = ...;
TupleTagList tags2 = TupleTagList.empty(p);
// Get TupleTags out of a TupleTagList, by index (origin 0):
TupleTag<?> tagX = tags.get(1);
TupleTag<?> tagY = tags.get(0);
TupleTag<?> tagZ = tags.get(2);
// Get a list of all TupleTags in a TupleTagList:
List<TupleTag<?>> allTags = tags.getAll();
Modifier and Type | Method and Description |
---|---|
TupleTagList |
and(java.util.List<TupleTag<?>> tags)
Returns a new
TupleTagList that has all the TupleTags of this TupleTagList plus the given TupleTags appended to the end, in order. |
TupleTagList |
and(TupleTag<?> tag)
Returns a new
TupleTagList that has all the TupleTags of this TupleTagList plus the given TupleTag appended to the end. |
static TupleTagList |
empty()
Returns an empty
TupleTagList . |
TupleTag<?> |
get(int index)
Returns the
TupleTag at the given index (origin zero). |
java.util.List<TupleTag<?>> |
getAll()
Returns an immutable List of all the
TupleTags in this TupleTagList . |
static TupleTagList |
of(java.util.List<TupleTag<?>> tags)
Returns a
TupleTagList containing the given TupleTags , in order. |
static TupleTagList |
of(TupleTag<?> tag)
Returns a singleton
TupleTagList containing the given TupleTag . |
int |
size()
Returns the number of TupleTags in this TupleTagList.
|
java.lang.String |
toString() |
public static TupleTagList empty()
TupleTagList
.
Longer TupleTagLists
can be created by calling and(org.apache.beam.sdk.values.TupleTag<?>)
on the
result.
public static TupleTagList of(TupleTag<?> tag)
TupleTagList
containing the given TupleTag
.
Longer TupleTagLists
can be created by calling and(org.apache.beam.sdk.values.TupleTag<?>)
on the
result.
public static TupleTagList of(java.util.List<TupleTag<?>> tags)
TupleTagList
containing the given TupleTags
, in order.
Longer TupleTagLists
can be created by calling and(org.apache.beam.sdk.values.TupleTag<?>)
on the
result.
public TupleTagList and(TupleTag<?> tag)
TupleTagList
that has all the TupleTags
of this TupleTagList
plus the given TupleTag
appended to the end.public TupleTagList and(java.util.List<TupleTag<?>> tags)
TupleTagList
that has all the TupleTags
of this TupleTagList
plus the given TupleTags
appended to the end, in order.public int size()
public TupleTag<?> get(int index)
TupleTag
at the given index (origin zero).java.lang.IndexOutOfBoundsException
- if the index is out of the range [0..size()-1]
.public java.util.List<TupleTag<?>> getAll()
TupleTags
in this TupleTagList
.public java.lang.String toString()
toString
in class java.lang.Object