Class Selectables

java.lang.Object
org.microbean.bean.Selectables

public final class Selectables extends Object
Utility methods for working with Selectables.
Author:
Laird Nelson
See Also:
  • Method Details

    • ambiguityReducing

      public static final <C,E> Selectable<C,E> ambiguityReducing(Selectable<C,E> s, Predicate<? super E> p, ToIntFunction<? super E> rankingFunction)
      Returns a Selectable that reduces any ambiguity in the results returned by another Selectable, considering notional alternate status and rank.
      Type Parameters:
      C - the criteria type
      E - the element type
      Parameters:
      s - a Selectable; must not be null
      p - a Predicate that tests whether an element is an alternate; may be null in which case it will be as if e -> false were supplied
      rankingFunction - a ToIntFunction that returns a rank for an alternate; a rank of 0 indicates no particular rank; may be null in which case it will be as if e -> 0 were supplied
      Returns:
      a non-null Selectable
      Throws:
      NullPointerException - if any argument is null