Interface References<R>
- Type Parameters:
R
- the contextual reference type
- All Superinterfaces:
Iterable<R>
,ReferencesSelector
An
Iterable
providing access to contextual references of a given type, and a ReferencesSelector
providing access to a References
of a different type.- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Destroys the supplied contextual reference if and only if it meets the conditions for destruction.default R
get()
A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from thisReferences
.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.microbean.bean.ReferencesSelector
references
-
Method Details
-
get
A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from thisReferences
.- Returns:
- a contextual reference; never
null
- Throws:
UnsatisfiedReductionException
- if there are no contextual referencesAmbiguousReductionException
- if there is more than one contextual reference
-
destroy
Destroys the supplied contextual reference if and only if it meets the conditions for destruction.- Parameters:
r
- a contextual reference; may benull
in which casefalse
will be returned- Returns:
true
if and only if destruction occurred- Throws:
DestructionException
- if an error occurs
-