Class Selectables
java.lang.Object
org.microbean.bean.Selectables
-
Method Summary
Modifier and TypeMethodDescriptionstatic final <C,E extends Ranked>
Selectable<C, E> ambiguityReducing(Selectable<C, E> s) Deprecated, for removal: This API element is subject to removal in a future version.static final <C,E> Selectable <C, E> ambiguityReducing(Selectable<C, E> s, Predicate<? super E> p, ToIntFunction<? super E> ranker) Returns aSelectablethat reduces any ambiguity in the results returned by anotherSelectable, considering alternate status and rank.static final Selectable<AttributedType, Bean<?>> typesafeReducing(Collection<? extends Bean<?>> beans, Matcher<? super AttributedType, ? super Id> m) Normalizes the suppliedCollectionofBeans and returns aSelectablefor it and the suppliedMatcher.
-
Method Details
-
ambiguityReducing
@Deprecated(forRemoval=true, since="0.0.19") public static final <C,E extends Ranked> Selectable<C,E> ambiguityReducing(Selectable<C, E> s) Deprecated, for removal: This API element is subject to removal in a future version.Please use theambiguityReducing(Selectable, Predicate, ToIntFunction)method instead.Returns aSelectablethat reduces any ambiguity in the results returned by anotherSelectable, considering alternate status and rank.- Type Parameters:
C- the criteria typeE- the element type- Parameters:
s- aSelectable; must not benull- Returns:
- a non-
nullSelectable - Throws:
NullPointerException- ifsisnull- See Also:
-
ambiguityReducing
public static final <C,E> Selectable<C,E> ambiguityReducing(Selectable<C, E> s, Predicate<? super E> p, ToIntFunction<? super E> ranker) Returns aSelectablethat reduces any ambiguity in the results returned by anotherSelectable, considering 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; must not benullranker- aToIntFunctionthat returns a rank for an alternate; a rank of0indicates no particular rank; must not benull- Returns:
- a non-
nullSelectable - Throws:
NullPointerException- if any argument isnull
-
typesafeReducing
public static final Selectable<AttributedType,Bean<?>> typesafeReducing(Collection<? extends Bean<?>> beans, Matcher<? super AttributedType, ? super Id> m) Normalizes the suppliedCollectionofBeans and returns aSelectablefor it and the suppliedMatcher.The
Selectabledoes not cache its results.- Parameters:
beans- aCollectionofBeans; must not benullm- anIdMatcher; must not benull- Returns:
- a non-
nullSelectable - Throws:
NullPointerException- if any argument isnull- See Also:
-
ambiguityReducing(Selectable, Predicate, ToIntFunction)method instead.