java.lang.Object
org.microbean.bean.Beans
- All Implemented Interfaces:
Reducible<AttributedType,
,Bean<?>> Selectable<AttributedType,
Bean<?>>
public final class Beans
extends Object
implements Selectable<AttributedType,Bean<?>>, Reducible<AttributedType,Bean<?>>
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorDescriptionBeans
(Selectable<AttributedType, Bean<?>> s, Reducible<AttributedType, Bean<?>> r) -
Method Summary
Modifier and TypeMethodDescriptionstatic final Selectable
<AttributedType, Bean<?>> cachingSelectableOf
(Matcher<? super AttributedType, ? super Id> idMatcher, Map<? extends AttributedType, ? extends List<Bean<?>>> selections, Collection<? extends Bean<?>> beans) final Bean
<?> Given a criteria object, which may benull
, returns an object that represents the reduction of a notional collection of objects.Selects and returns an immutableList
representing a sublist of thisSelectable
's elements, as mediated by the supplied criteria.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.microbean.bean.Selectable
list
-
Constructor Details
-
Beans
-
-
Method Details
-
select
Description copied from interface:Selectable
Selects and returns an immutableList
representing a sublist of thisSelectable
's elements, as mediated by the supplied criteria.Implementations of this method must be idempotent and must return a determinate value.
Implementations of this method must not return
null
.Implementations of this method should not call
Selectable.list()
, since that method is typically implemented in terms of this one.- Specified by:
select
in interfaceSelectable<AttributedType,
Bean<?>> - Parameters:
c
- the criteria to use; may benull
- Returns:
- an immutable sublist of this
Selectable
's elements; nevernull
- See Also:
-
reduce
Description copied from interface:Reducible
Given a criteria object, which may benull
, returns an object that represents the reduction of a notional collection of objects.Most
Reducible
implementations will return determine values from invocations of this method, but there is no requirement to do so.- Specified by:
reduce
in interfaceReducible<AttributedType,
Bean<?>> - Parameters:
c
- the criteria; may benull
to indicate no criteria- Returns:
- a single object, or
null
-
cachingSelectableOf
public static final Selectable<AttributedType,Bean<?>> cachingSelectableOf(Matcher<? super AttributedType, ? super Id> idMatcher, Map<? extends AttributedType, ? extends List<Bean<?>>> selections, Collection<? extends Bean<?>> beans)
-