Package org.apache.beam.sdk.values
Class TupleTagList
java.lang.Object
org.apache.beam.sdk.values.TupleTagList
- All Implemented Interfaces:
Serializable
A
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();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a newTupleTagListthat has all theTupleTagsof thisTupleTagListplus the givenTupleTagsappended to the end, in order.Returns a newTupleTagListthat has all theTupleTagsof thisTupleTagListplus the givenTupleTagappended to the end.static TupleTagListempty()Returns an emptyTupleTagList.TupleTag<?> get(int index) Returns theTupleTagat the given index (origin zero).getAll()Returns an immutable List of all theTupleTagsin thisTupleTagList.static TupleTagListReturns aTupleTagListcontaining the givenTupleTags, in order.static TupleTagListReturns a singletonTupleTagListcontaining the givenTupleTag.intsize()Returns the number of TupleTags in this TupleTagList.toString()
-
Method Details
-
empty
Returns an emptyTupleTagList.Longer
TupleTagListscan be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)on the result. -
of
Returns a singletonTupleTagListcontaining the givenTupleTag.Longer
TupleTagListscan be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)on the result. -
of
Returns aTupleTagListcontaining the givenTupleTags, in order.Longer
TupleTagListscan be created by callingand(org.apache.beam.sdk.values.TupleTag<?>)on the result. -
and
Returns a newTupleTagListthat has all theTupleTagsof thisTupleTagListplus the givenTupleTagappended to the end. -
and
Returns a newTupleTagListthat has all theTupleTagsof thisTupleTagListplus the givenTupleTagsappended to the end, in order. -
size
public int size()Returns the number of TupleTags in this TupleTagList. -
get
Returns theTupleTagat the given index (origin zero).- Throws:
IndexOutOfBoundsException- if the index is out of the range[0..size()-1].
-
getAll
Returns an immutable List of all theTupleTagsin thisTupleTagList. -
toString
-