Package com.hazelcast.jet.core.test
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 forinbox.queue().add(o)
void
addAll(Collection<?> collection)
Convenience forinbox.queue().addAll(collection)
void
clear()
Convenience forinbox.queue().clear()
boolean
isEmpty()
Returnstrue
if this inbox contains no elements,false
otherwise.Object
peek()
Retrieves, but does not remove, the head of this inbox, or returnsnull
if it is empty.Object
poll()
Retrieves and removes the head of this inbox, or returnsnull
if it is empty.Deque<Object>
queue()
Retrieves the queue backing the inbox.void
remove()
Removes the head of this inbox.int
size()
Convenience forinbox.queue().size()
String
toString()
-
Constructor Details
-
TestInbox
public TestInbox()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from interface:Inbox
Returnstrue
if this inbox contains no elements,false
otherwise. -
peek
Description copied from interface:Inbox
Retrieves, but does not remove, the head of this inbox, or returnsnull
if it is empty. -
poll
Description copied from interface:Inbox
Retrieves and removes the head of this inbox, or returnsnull
if it is empty. -
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. -
queue
Retrieves the queue backing the inbox. -
add
Convenience forinbox.queue().add(o)
-
addAll
Convenience forinbox.queue().addAll(collection)
-
clear
public void clear()Convenience forinbox.queue().clear()
-
size
public int size()Convenience forinbox.queue().size()
-
toString
-