Package bm.util

Class StringLister

java.lang.Object
bm.util.Lister<String>
bm.util.StringLister

@Deprecated public class StringLister extends Lister<String>
Deprecated.
Mixing this with Lister is no good because a return this in a superclass function returns the wrong type, namely Lister<String> not StringLister.
Fluent api to build up a List of String from various ingredients. The list is constructed in place, using an ArrayList internally.
  • Constructor Details

    • StringLister

      public StringLister(String... elements)
      Deprecated.
      Creates an initial list.
      Parameters:
      elements - initial list elements
  • Method Details

    • add

      public StringLister add(Object o)
      Deprecated.
    • addJoined

      public StringLister addJoined(String joiner, Collection<String> args)
      Deprecated.
      Joins a collections and adds it to the list
      Parameters:
      joiner - separater to join the elements
      args - to join
      Returns:
      this
    • addJoined

      public <T> StringLister addJoined(Function<T,String> mapper, String joiner, Collection<T> args)
      Deprecated.
      Joins collection elements after mapping them and adds the result to this list.
      Type Parameters:
      T - type of the elements in the collection
      Parameters:
      mapper - to map elements of the given collection
      joiner - to join the resulting strings
      args - the elements to join
      Returns:
      this