Class Selectables
java.lang.Object
org.microbean.bean.Selectables
Utility methods for working with
Selectables.- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic final <C,E> Selectable <C, E> ambiguityReducing(Selectable<C, E> s, Predicate<? super E> p, ToIntFunction<? super E> rankingFunction) Returns aSelectablethat reduces any ambiguity in the results returned by anotherSelectable, considering notional alternate status and rank.
-
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 aSelectablethat reduces any ambiguity in the results returned by anotherSelectable, considering notional alternate status and rank.- Type Parameters:
C- the criteria typeE- the element type- Parameters:
s- aSelectable; must not benullp- aPredicatethat tests whether an element is an alternate; may benullin which case it will be as ife -> falsewere suppliedrankingFunction- aToIntFunctionthat returns a rank for an alternate; a rank of0indicates no particular rank; may benullin which case it will be as ife -> 0were supplied- Returns:
- a non-
nullSelectable - Throws:
NullPointerException- if any argument isnull
-