Class ScopedInstances
java.lang.Object
org.microbean.scopelet.ScopedInstances
- All Implemented Interfaces:
AutoCloseable
,Instances
An
Instances
implementation that is based on scopes.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Attributes
findScopeId
(Collection<? extends Attributes> c) Finds and returns the nearest scope identifier in the forest represented by the suppliedAttributes
.protected boolean
Returnstrue
if and only if the suppliedAttributes
is deemed to be an identifier of a scope.protected boolean
primordial
(Collection<? extends Attributes> c) Returnstrue
if and only if the suppliedCollection
ofAttributes
is deemed to designate something as primordial.boolean
Returnstrue
if and only if the suppliedId
is proxiable.static final Reducible
<AttributedType, Bean<?>> reducible
(Domain domain, Selectable<AttributedType, Bean<?>> selectable) static final Reducible
<AttributedType, Bean<?>> reducible
(Domain domain, Selectable<AttributedType, Bean<?>> selectable, Reducer<AttributedType, Bean<?>> reducer) static final Reducible
<AttributedType, Bean<?>> reducible
(Domain domain, Selectable<AttributedType, Bean<?>> selectable, Reducer<AttributedType, Bean<?>> reducer, BiFunction<? super List<? extends Bean<?>>, ? super AttributedType, ? extends Bean<?>> failureHandler) final <I> Supplier
<? extends I>
-
Constructor Details
-
ScopedInstances
Creates a newScopedInstances
.- Parameters:
domain
- aDomain
; must not benull
- Throws:
NullPointerException
- ifdomain
isnull
-
-
Method Details
-
findScopeId
Finds and returns the nearest scope identifier in the forest represented by the suppliedAttributes
.- Parameters:
c
- aCollection
ofAttributes
; must not benull
- Returns:
- the nearest scope identifier in the forest represented by the supplied
Attributes
, ornull
- Throws:
NullPointerException
- ifc
isnull
-
isScopeId
Returnstrue
if and only if the suppliedAttributes
is deemed to be an identifier of a scope.- Parameters:
a
- anAttributes
; must not benull
- Returns:
true
if and only if the suppliedAttributes
is deemed to be an identifier of a scope- Throws:
NullPointerException
- ifa
isnull
-
primordial
Returnstrue
if and only if the suppliedCollection
ofAttributes
is deemed to designate something as primordial.The default implementation of this method returns
true
if and only if the suppliedCollection
contains the primordial qualifier.- Parameters:
c
- aCollection
; must not benull
- Returns:
true
if and only if the suppliedCollection
ofAttributes
is deemed to designate something as primordial- Throws:
NullPointerException
- ifc
isnull
-
proxiable
-
supplier
-
reducible
public static final Reducible<AttributedType,Bean<?>> reducible(Domain domain, Selectable<AttributedType, Bean<?>> selectable) - Parameters:
domain
- aDomain
(that is normally shared among other cooperating components); must not benull
selectable
- aSelectable
; must not benull
- Returns:
- a non-
null
Reducible
- Throws:
NullPointerException
- if any argument isnull
- See Also:
-
reducible
public static final Reducible<AttributedType,Bean<?>> reducible(Domain domain, Selectable<AttributedType, Bean<?>> selectable, Reducer<AttributedType, Bean<?>> reducer) - Parameters:
domain
- aDomain
(that is normally shared among other cooperating components); must not benull
selectable
- aSelectable
; must not benull
reducer
- aReducer
; must not benull
- Returns:
- a non-
null
Reducible
- Throws:
NullPointerException
- if any argument isnull
- See Also:
-
reducible
public static final Reducible<AttributedType,Bean<?>> reducible(Domain domain, Selectable<AttributedType, Bean<?>> selectable, Reducer<AttributedType, Bean<?>> reducer, BiFunction<? super List<? extends Bean<?>>, ? super AttributedType, ? extends Bean<?>> failureHandler) - Parameters:
domain
- aDomain
(that is normally shared among other cooperating components); must not benull
selectable
- aSelectable
; must not benull
reducer
- aReducer
; must not benull
failureHandler
- aBiFunction
serving as the suppliedReducer
's failure handler; must not benull
- Returns:
- a non-
null
Reducible
- Throws:
NullPointerException
- if any argument isnull
-