Interface Request<I>
- Type Parameters:
I
- the type of the contextual reference
- All Superinterfaces:
Creation<I>
A request for a contextual reference of a particular attributed type, along with functionality to help fulfil the
request.
- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns theBeanReduction
describing thisRequest
in progress.<J> Request
<J> child
(BeanReduction<J> beanReduction) Returns aRequest
that is conceptually a child of thisRequest
and that represents a request for a contextual reference satisfying the suppliedBeanReduction
.default boolean
Returnstrue
if and only if thisRequest
implementation is the primordial request.default <R> R
reference
(AttributedType attributedType) Acquires a contextual reference that matches the suppliedAttributedType
and returns it.<R> R
reference
(AttributedType attributedType, Bean<R> bean, Creation<R> creation) Returns a contextual reference that matches the suppliedAttributedType
, using the suppliedBean
to disambiguate otherwise ambiguous contextual reference selections.default <R> R
reference
(AttributedType attributedType, Creation<R> creation) Returns a contextual reference that matches the suppliedAttributedType
.
-
Method Details
-
beanReduction
Returns theBeanReduction
describing thisRequest
in progress.- Returns:
- the
BeanReduction
describing thisRequest
in progress, ornull
if this is the primordial request - See Also:
- Idempotency:
- Implementations of this method must be idempotent and deterministic.
- Nullability:
- Implementations of this method may return
null
, but only to represent the primordial request. - Thread Safety:
- Implementations of this method must be safe for concurrent use by multiple threads.
-
child
Returns aRequest
that is conceptually a child of thisRequest
and that represents a request for a contextual reference satisfying the suppliedBeanReduction
.If the supplied
BeanReduction
is equal to the return value of an invocation of thisRequest
'sbeanReduction()
method, it is permissible for thisRequest
to be returned instead of a new child.- Type Parameters:
J
- the type of contextual reference returned by the childRequest
- Parameters:
beanReduction
- aBeanReduction
; must not benull
- Returns:
- a
Request
that is conceptually a child of thisRequest
and that represents a request for a contextual reference satisfying the suppliedBeanReduction
; nevernull
- Throws:
NullPointerException
- ifbeanReduction
isnull
-
primordial
Returnstrue
if and only if thisRequest
implementation is the primordial request.The default implementation of this method returns
true
if and only if the return value of an invocation of thebeanReduction()
method isnull
.- Returns:
true
if and only if thisRequest
is the primordial request
-
reference
Acquires a contextual reference that matches the suppliedAttributedType
and returns it.- Type Parameters:
R
- the type of contextual reference- Parameters:
attributedType
- anAttributedType
; must not benull
- Returns:
- a contextual reference, which may be
null
- Throws:
NullPointerException
- ifattributedtype
isnull
-
reference
Returns a contextual reference that matches the suppliedAttributedType
, using the suppliedBean
to disambiguate otherwise ambiguous contextual reference selections.- Type Parameters:
R
- the type of contextual reference- Parameters:
attributedType
- anAttributedType
; must not benull
bean
- aBean
that can be used to disambiguate otherwise ambiguous contextual reference selections; may (commonly) benull
if the caller expects there to be no ambiguitycreation
- aCreation
; must not benull
- Returns:
- a contextual reference; never
null
- Throws:
NullPointerException
- ifattributedType
orcreation
isnull
-
reference
Returns a contextual reference that matches the suppliedAttributedType
.- Type Parameters:
R
- the type of contextual reference- Parameters:
attributedType
- anAttributedType
; must not benull
creation
- aCreation
; must not benull
- Returns:
- a contextual reference; never
null
- Throws:
NullPointerException
- ifattributedType
orcreation
isnull
-