Interface Closable.CloseBuilder<B extends Closable.CloseBuilder<B>>

Type Parameters:
B - The instance to be returned on which to apply succeeding builder operations.
All Known Subinterfaces:
ConnectionComponent.ConnectionComponentBuilder<CON,B>, LinkComponent.LinkComponentBuilder<B>
Enclosing interface:
Closable

public static interface Closable.CloseBuilder<B extends Closable.CloseBuilder<B>>
To enable the Closable functionality to be invoked in a builder chain.
  • Method Details

    • withClose

      B withClose() throws IOException
      Builder method for the Closable.close() method.
      Returns:
      The instance to be returned on which to apply succeeding builder operations.
      Throws:
      IOException - in case closing or pre-closing (flushing) fails.
    • withCloseQuietly

      B withCloseQuietly()
      Builder method for the Closable.closeQuietly() method.
      Returns:
      The instance to be returned on which to apply succeeding builder operations.
    • withCloseIn

      B withCloseIn(int aCloseMillis)
      Builder method for the Closable.closeIn(int) method.
      Parameters:
      aCloseMillis - The time in milliseconds to pass till Closable.close() is called.
      Returns:
      The instance to be returned on which to apply succeeding builder operations.
    • withCloseUnchecked

      default B withCloseUnchecked()
      Closes the component by calling withClose() without you to require catching an IOException.
      Returns:
      The instance to be returned on which to apply succeeding builder operations.
      Throws:
      org.refcodes.exception.RuntimeIOException - encapsulates the aCause and is thrown upon encountering a IOException exception