Class Instance<I>
java.lang.Object
org.microbean.scopelet.Instance<I>
- Type Parameters:
I
- the type of the instance
- All Implemented Interfaces:
AutoCloseable
,Supplier<I>
An
AutoCloseable
pairing of a contextual instance that can be destroyed with a Instance.Destructor
that can
destroy it, an AutoCloseable
that can release its dependent objects when needed, and a Request
that
caused it to be created.- Author:
- Laird Nelson
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
An interface whose implementations can destroy contextual instances. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Instance
public Instance(I contextualInstance, Instance.Destructor<I> destructor, Request<I> creationRequest) Creates a newInstance
.- Parameters:
contextualInstance
- a contextual instance that has just been created; may benull
destructor
- aInstance.Destructor
capable of (eventually) destroying the suppliedcontextualInstance
; may benull
creationRequest
- aRequest
that is the reason for this creation; may benull
-
-
Method Details
-
get
-
close
- Specified by:
close
in interfaceAutoCloseable
-
closed
-
hashCode
-
equals
-
toString
-