Package org.apache.commons.lang3
Class ThreadUtils.NamePredicate
- java.lang.Object
-
- org.apache.commons.lang3.ThreadUtils.NamePredicate
-
- All Implemented Interfaces:
ThreadUtils.ThreadGroupPredicate,ThreadUtils.ThreadPredicate
- Enclosing class:
- ThreadUtils
public static class ThreadUtils.NamePredicate extends Object implements ThreadUtils.ThreadPredicate, ThreadUtils.ThreadGroupPredicate
A predicate implementation which matches a thread or threadgroup name.
-
-
Constructor Summary
Constructors Constructor Description NamePredicate(String name)Predicate constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleantest(Thread thread)Evaluates this predicate on the given thread.booleantest(ThreadGroup threadGroup)Evaluates this predicate on the given threadgroup.
-
-
-
Constructor Detail
-
NamePredicate
public NamePredicate(String name)
Predicate constructor- Parameters:
name- thread or threadgroup name- Throws:
IllegalArgumentException- if the name isnull
-
-
Method Detail
-
test
public boolean test(Thread thread)
Description copied from interface:ThreadUtils.ThreadPredicateEvaluates this predicate on the given thread.- Specified by:
testin interfaceThreadUtils.ThreadPredicate- Parameters:
thread- the thread- Returns:
trueif the thread matches the predicate, otherwisefalse
-
test
public boolean test(ThreadGroup threadGroup)
Description copied from interface:ThreadUtils.ThreadGroupPredicateEvaluates this predicate on the given threadgroup.- Specified by:
testin interfaceThreadUtils.ThreadGroupPredicate- Parameters:
threadGroup- the threadgroup- Returns:
trueif the threadGroup matches the predicate, otherwisefalse
-
-