Package org.apache.beam.sdk.values
Class TupleTagList
- java.lang.Object
-
- org.apache.beam.sdk.values.TupleTagList
-
- All Implemented Interfaces:
java.io.Serializable
public class TupleTagList extends java.lang.Object implements java.io.Serializable
ATupleTagList
is an immutable list of heterogeneously typedTupleTags
. ATupleTagList
is used, for instance, to specify the tags of the additional outputs of aParDo
.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();
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TupleTagList
and(java.util.List<TupleTag<?>> tags)
Returns a newTupleTagList
that has all theTupleTags
of thisTupleTagList
plus the givenTupleTags
appended to the end, in order.TupleTagList
and(TupleTag<?> tag)
Returns a newTupleTagList
that has all theTupleTags
of thisTupleTagList
plus the givenTupleTag
appended to the end.static TupleTagList
empty()
Returns an emptyTupleTagList
.TupleTag<?>
get(int index)
Returns theTupleTag
at the given index (origin zero).java.util.List<TupleTag<?>>
getAll()
Returns an immutable List of all theTupleTags
in thisTupleTagList
.static TupleTagList
of(java.util.List<TupleTag<?>> tags)
Returns aTupleTagList
containing the givenTupleTags
, in order.static TupleTagList
of(TupleTag<?> tag)
Returns a singletonTupleTagList
containing the givenTupleTag
.int
size()
Returns the number of TupleTags in this TupleTagList.java.lang.String
toString()
-
-
-
Method Detail
-
empty
public static TupleTagList empty()
Returns an emptyTupleTagList
.Longer
TupleTagLists
can be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)
on the result.
-
of
public static TupleTagList of(TupleTag<?> tag)
Returns a singletonTupleTagList
containing the givenTupleTag
.Longer
TupleTagLists
can be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)
on the result.
-
of
public static TupleTagList of(java.util.List<TupleTag<?>> tags)
Returns aTupleTagList
containing the givenTupleTags
, in order.Longer
TupleTagLists
can be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)
on the result.
-
and
public TupleTagList and(TupleTag<?> tag)
Returns a newTupleTagList
that has all theTupleTags
of thisTupleTagList
plus the givenTupleTag
appended to the end.
-
and
public TupleTagList and(java.util.List<TupleTag<?>> tags)
Returns a newTupleTagList
that has all theTupleTags
of thisTupleTagList
plus the givenTupleTags
appended to the end, in order.
-
size
public int size()
Returns the number of TupleTags in this TupleTagList.
-
get
public TupleTag<?> get(int index)
Returns theTupleTag
at the given index (origin zero).- Throws:
java.lang.IndexOutOfBoundsException
- if the index is out of the range[0..size()-1]
.
-
getAll
public java.util.List<TupleTag<?>> getAll()
Returns an immutable List of all theTupleTags
in thisTupleTagList
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-