public class TupleTagList extends Object implements Serializable
TupleTagList is an immutable list of heterogeneously
typed TupleTags. A TupleTagList is used, for instance, to
specify the tags of the side outputs of a
ParDo.
TupleTagLists 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(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).
|
List<TupleTag<?>> |
getAll()
Returns an immutable List of all the TupleTags in this TupleTagList.
|
static TupleTagList |
of(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.
|
public static TupleTagList empty()
Longer TupleTagLists can be created by calling
and(com.google.cloud.dataflow.sdk.values.TupleTag<?>) on the result.
public static TupleTagList of(TupleTag<?> tag)
Longer TupleTagLists can be created by calling
and(com.google.cloud.dataflow.sdk.values.TupleTag<?>) on the result.
public static TupleTagList of(List<TupleTag<?>> tags)
Longer TupleTagLists can be created by calling
and(com.google.cloud.dataflow.sdk.values.TupleTag<?>) on the result.
public TupleTagList and(TupleTag<?> tag)
public TupleTagList and(List<TupleTag<?>> tags)
public int size()
public TupleTag<?> get(int index)
[0..size()-1].