Class TestInbox

java.lang.Object
com.hazelcast.jet.core.test.TestInbox
All Implemented Interfaces:
Inbox

public final class TestInbox
extends Object
implements Inbox
Inbox implementation suitable to be used in tests.
Since:
3.0
  • Constructor Summary

    Constructors 
    Constructor Description
    TestInbox()  
  • Method Summary

    Modifier and Type Method Description
    void add​(Object o)
    Convenience for inbox.queue().add(o)
    void addAll​(Collection<?> collection)
    Convenience for inbox.queue().addAll(collection)
    void clear()
    Convenience for inbox.queue().clear()
    boolean isEmpty()
    Returns true if this inbox contains no elements, false otherwise.
    Object peek()
    Retrieves, but does not remove, the head of this inbox, or returns null if it is empty.
    Object poll()
    Retrieves and removes the head of this inbox, or returns null if it is empty.
    Deque<Object> queue()
    Retrieves the queue backing the inbox.
    void remove()
    Removes the head of this inbox.
    int size()
    Convenience for inbox.queue().size()
    String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.hazelcast.jet.core.Inbox

    drain, drainTo, drainTo
  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Inbox
      Returns true if this inbox contains no elements, false otherwise.
      Specified by:
      isEmpty in interface Inbox
    • peek

      public Object peek()
      Description copied from interface: Inbox
      Retrieves, but does not remove, the head of this inbox, or returns null if it is empty.
      Specified by:
      peek in interface Inbox
    • poll

      public Object poll()
      Description copied from interface: Inbox
      Retrieves and removes the head of this inbox, or returns null if it is empty.
      Specified by:
      poll in interface Inbox
    • remove

      public void remove()
      Description copied from interface: Inbox
      Removes the head of this inbox. This method throws an exception if the inbox is empty.
      Specified by:
      remove in interface Inbox
    • queue

      public Deque<Object> queue()
      Retrieves the queue backing the inbox.
    • add

      public void add​(Object o)
      Convenience for inbox.queue().add(o)
    • addAll

      public void addAll​(Collection<?> collection)
      Convenience for inbox.queue().addAll(collection)
    • clear

      public void clear()
      Convenience for inbox.queue().clear()
    • size

      public int size()
      Convenience for inbox.queue().size()
      Specified by:
      size in interface Inbox
    • toString

      public String toString()
      Overrides:
      toString in class Object