Package net.groboclown.retval.monitor
Class MockObservedMonitor.Registered<T>
- java.lang.Object
-
- net.groboclown.retval.monitor.MockObservedMonitor.Registered<T>
-
- All Implemented Interfaces:
ObservedMonitor.Listener
- Enclosing class:
- MockObservedMonitor<T>
public static class MockObservedMonitor.Registered<T> extends java.lang.Object implements ObservedMonitor.Listener
Tracks the number of times the closeable is called.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCallCount()Get the number of times theonObserved()method was called.TgetObservable()Get the closeable instance.voidonObserved()Called when the observable object has its specific action called.booleanwasObserved()Return if this closeable object had theonObserved()()} method called.
-
-
-
Method Detail
-
getCallCount
public int getCallCount()
Get the number of times theonObserved()method was called.- Returns:
- closed invocation count
-
wasObserved
public boolean wasObserved()
Return if this closeable object had theonObserved()()} method called.- Returns:
- true if the on close method was called, otherwise false.
-
onObserved
public void onObserved()
Description copied from interface:ObservedMonitor.ListenerCalled when the observable object has its specific action called.- Specified by:
onObservedin interfaceObservedMonitor.Listener
-
getObservable
@Nonnull public T getObservable()
Get the closeable instance.- Returns:
- closeable instance
-
-