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 AttributesfindScopeId(Collection<? extends Attributes> c) Finds and returns the nearest scope identifier in the forest represented by the suppliedAttributes.protected booleanReturnstrueif and only if the suppliedAttributesis deemed to be an identifier of a scope.protected booleanprimordial(Collection<? extends Attributes> c) Returnstrueif and only if the suppliedCollectionofAttributesis deemed to designate something as primordial.booleanReturnstrueif and only if the suppliedIdis 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- ifdomainisnull
-
-
Method Details
-
findScopeId
Finds and returns the nearest scope identifier in the forest represented by the suppliedAttributes.- Parameters:
c- aCollectionofAttributes; must not benull- Returns:
- the nearest scope identifier in the forest represented by the supplied
Attributes, ornull - Throws:
NullPointerException- ifcisnull
-
isScopeId
Returnstrueif and only if the suppliedAttributesis deemed to be an identifier of a scope.- Parameters:
a- anAttributes; must not benull- Returns:
trueif and only if the suppliedAttributesis deemed to be an identifier of a scope- Throws:
NullPointerException- ifaisnull
-
primordial
Returnstrueif and only if the suppliedCollectionofAttributesis deemed to designate something as primordial.The default implementation of this method returns
trueif and only if the suppliedCollectioncontains the primordial qualifier.- Parameters:
c- aCollection; must not benull- Returns:
trueif and only if the suppliedCollectionofAttributesis deemed to designate something as primordial- Throws:
NullPointerException- ifcisnull
-
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 benullselectable- aSelectable; must not benull- Returns:
- a non-
nullReducible - 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 benullselectable- aSelectable; must not benullreducer- aReducer; must not benull- Returns:
- a non-
nullReducible - 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 benullselectable- aSelectable; must not benullreducer- aReducer; must not benullfailureHandler- aBiFunctionserving as the suppliedReducer's failure handler; must not benull- Returns:
- a non-
nullReducible - Throws:
NullPointerException- if any argument isnull
-