Class Tuple2.ListBuilder<B,C>

java.lang.Object
eu.bandm.tools.util.anon.Tuple2.ListBuilder<B,C>
Type Parameters:
B - the type of the first component.
C - the type of the second component.
Enclosing class:
Tuple2<A0,A1>

public static class Tuple2.ListBuilder<B,C> extends Object
Convenience class for building a list of 2-tuples. Usage: (a) Create an instance, (b) call add(B, C) repeatedly, (c) call close(). Afterwards, (b) and (c) can be repeated.
  • Constructor Details

    • ListBuilder

      public ListBuilder()
      Only constructor.
  • Method Details

    • add

      public Tuple2.ListBuilder<B,C> add(B a, C b)
      Add a 2-tuple to the list under construction.
      Parameters:
      a - the value of the first component.
      b - the value of the second component.
      Returns:
      this instance, for method chaining.
    • close

      public List<Tuple2<B,C>> close()
      Return the result, as constructed so far.
      Returns:
      the constructed list of 2-tuples.