Package com.hazelcast.jet.core.test
Class TestInbox
java.lang.Object
com.hazelcast.jet.core.test.TestInbox
Inbox
implementation suitable to be used in tests.- Since:
- Jet 3.0
-
Constructor Summary
ConstructorDescriptionConstructs the inbox.TestInbox
(Collection<?> collection) Convenience fornew TestInbox().queue().addAll(o)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.iterator()
Returns an iterator over the items in the inbox in the order they would be returned by theInbox.poll()
method.peek()
Retrieves, but does not remove, the head of this inbox, or returnsnull
if it is empty.poll()
Retrieves and removes the head of this inbox, or returnsnull
if it is empty.queue()
Retrieves the queue backing the inbox.void
remove()
Removes the head of this inbox.int
size()
Convenience forinbox.queue().size()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TestInbox
public TestInbox()Constructs the inbox. -
TestInbox
Convenience fornew TestInbox().queue().addAll(o)
-
-
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)
-
iterator
Description copied from interface:Inbox
Returns an iterator over the items in the inbox in the order they would be returned by theInbox.poll()
method.The returned iterator doesn't support the
Iterator.remove()
method. -
clear
public void clear()Convenience forinbox.queue().clear()
-
size
public int size()Convenience forinbox.queue().size()
-
toString
-