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
ConstructorsConstructorDescriptionConstructs the inbox.TestInbox(Collection<?> collection) Convenience fornew TestInbox().queue().addAll(o) -
Method Summary
Modifier and TypeMethodDescriptionvoidConvenience forinbox.queue().add(o)voidaddAll(Collection<?> collection) Convenience forinbox.queue().addAll(collection)voidclear()Convenience forinbox.queue().clear()booleanisEmpty()Returnstrueif this inbox contains no elements,falseotherwise.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 returnsnullif it is empty.poll()Retrieves and removes the head of this inbox, or returnsnullif it is empty.queue()Retrieves the queue backing the inbox.voidremove()Removes the head of this inbox.intsize()Convenience forinbox.queue().size()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:InboxReturnstrueif this inbox contains no elements,falseotherwise. -
peek
Description copied from interface:InboxRetrieves, but does not remove, the head of this inbox, or returnsnullif it is empty. -
poll
Description copied from interface:InboxRetrieves and removes the head of this inbox, or returnsnullif it is empty. -
remove
public void remove()Description copied from interface:InboxRemoves 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:InboxReturns 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
-