- All Superinterfaces:
Flushable
- All Known Subinterfaces:
ComponentComposite
,ComponentComposite.ExtendedComponentComposite<CTX,
,CON> Flushable.FlushBuilder<B>
- All Known Implementing Classes:
AbstractComponentComposite
,AbstractComponentComposite.ExtendedCompositeComponentImpl
This mixin might be implemented by a component in order to provide flush
facilities. A dedicated interface has been created just extending Java's
Flushable
interface to lift it onto the component's layer.
ATTENTION: When implementing flush functionality, use this Flushable
,
though when testing for reset functionality, use Flushable
(instanceof
)!
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Flushable.FlushBuilder<B extends Flushable.FlushBuilder<B>>
The Interface FlushBuilder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
default void
Flushes the component by callingflush()
without you to require catching aIOException
.default boolean
Determines whether the implementing instance can safely be flushed.
-
Method Details
-
flush
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
-
flushUnchecked
default void flushUnchecked()Flushes the component by callingflush()
without you to require catching aIOException
.- Throws:
org.refcodes.exception.RuntimeIOException
- encapsulates the aCause and is thrown upon encountering aIOException
exception
-
isFlushable
default boolean isFlushable()Determines whether the implementing instance can safely be flushed. When false is returned, then callingflush()
would result in anIOException
exception to be thrown.- Returns:
- True in case
flush()
can be called without throwing anIOException
.
-