Class ManagedConsumer<T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.function.Consumer<T>, AutoConsumer<T>, AutoFunctional

    final class ManagedConsumer<T>
    extends java.lang.Object
    implements AutoConsumer<T>
    • Constructor Summary

      Constructors 
      Constructor Description
      ManagedConsumer​(Throughput manager, java.util.function.Consumer<T> consumer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(T item)
      Write the item to the consumer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • Field Detail

      • myConsumer

        private final java.util.function.Consumer<T> myConsumer
    • Constructor Detail

      • ManagedConsumer

        ManagedConsumer​(Throughput manager,
                        java.util.function.Consumer<T> consumer)
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface AutoConsumer<T>
        Throws:
        java.lang.Exception
      • write

        public void write​(T item)
        Description copied from interface: AutoConsumer
        Write the item to the consumer.
        Specified by:
        write in interface AutoConsumer<T>
        Parameters:
        item - The item to be written