public final class ContainerHelper
extends java.lang.Object
CallableContainer
or RunnableContainer
.Constructor and Description |
---|
ContainerHelper() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.Runnable> |
getContainedRunnables(java.util.List<? extends RunnableContainer> sourceList)
Takes in a list of runnable containers, and instead makes a list of the runnables which are
contained in each item of the list.
|
static boolean |
isContained(java.lang.Runnable startRunnable,
java.util.concurrent.Callable<?> compareTo)
Checks if the start runnable contains the provided callable.
|
static boolean |
isContained(java.lang.Runnable startRunnable,
java.lang.Runnable compareTo)
Checks if the start runnable equals the compareTo runnable, or if the compareTo runnable is
contained within a wrapper of the startRunnable.
|
static boolean |
remove(java.util.Collection<? extends RunnableContainer> source,
java.util.concurrent.Callable<?> compareTo)
Attempts to remove the provided callable from the source collection.
|
static boolean |
remove(java.util.Collection<? extends RunnableContainer> source,
java.lang.Runnable compareTo)
Attempts to remove the provided runnable from the source collection.
|
public static boolean remove(java.util.Collection<? extends RunnableContainer> source, java.lang.Runnable compareTo)
Collection.remove(Object)
function to remove the container if it is found.source
- source collection to search overcompareTo
- Runnable to compare against in searchtrue
if collection was modifiedpublic static boolean remove(java.util.Collection<? extends RunnableContainer> source, java.util.concurrent.Callable<?> compareTo)
Collection.remove(Object)
function to remove the container if it is found.source
- source collection to search overcompareTo
- Callable to compare against in searchtrue
if collection was modifiedpublic static boolean isContained(java.lang.Runnable startRunnable, java.lang.Runnable compareTo)
startRunnable
- runnable to start search atcompareTo
- runnable to be comparing againsttrue
if they are equivalent, or the compareTo runnable is contained within the startpublic static boolean isContained(java.lang.Runnable startRunnable, java.util.concurrent.Callable<?> compareTo)
startRunnable
- runnable to start search atcompareTo
- callable to be comparing againsttrue
if the compareTo runnable is contained within the runnablepublic static java.util.List<java.lang.Runnable> getContainedRunnables(java.util.List<? extends RunnableContainer> sourceList)
sourceList
- List of runnable containers to get interior runnable from