Interface ReferencesSelector
- All Known Subinterfaces:
Creation<I>,Destruction,References<R>
public interface ReferencesSelector
A supplier of
References objects.- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDestroys the supplied contextual reference if and only if it meets the conditions for destruction.default <R> RA convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference of the relevant type.<R> References<R> Returns aReferencescapable of locating contextual references of the relevant type.
-
Method Details
-
destroy
Destroys the supplied contextual reference if and only if it meets the conditions for destruction.- Parameters:
r- a contextual reference; may benullin which casefalsewill be returned- Returns:
trueif and only if destruction occurred- Throws:
DestructionException- if an error occurs
-
references
Returns aReferencescapable of locating contextual references of the relevant type.- Type Parameters:
R- the contextual reference type- Parameters:
t- anAttributedTypedescribing the contextual reference type; must not benull- Returns:
- a non-
nullReferences - Throws:
NullPointerException- iftisnull- See Also:
-
reference
A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference of the relevant type.- Type Parameters:
R- the contextual reference type- Parameters:
t- anAttributedTypedescribing the contextual reference type; must not benull- Returns:
- a non-
nullcontextual reference - Throws:
NullPointerException- iftisnullUnsatisfiedReductionException- if there is no contextual reference for the relevant typeAmbiguousReductionException- if there is more than one contextual reference for the relevant type- See Also:
-