Class Instance<I>
java.lang.Object
org.microbean.scopelet.Instance<I>
- Type Parameters:
I
- the contextual instance type
- 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 and a Destruction
view of the Creation
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
ConstructorsConstructorDescriptionInstance
(I contextualInstance, Instance.Destructor<I> destructor, Destruction destruction) Creates a newInstance
. -
Method Summary
-
Constructor Details
-
Instance
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
destruction
- aDestruction
; may benull
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
closed
-
equals
-
get
-
hashCode
-
toString
-