|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.camunda.bpm.engine.impl.util.CompareUtil
public class CompareUtil
Util class for comparisons.
| Constructor Summary | |
|---|---|
CompareUtil()
|
|
| Method Summary | ||
|---|---|---|
static
|
areNotInAscendingOrder(List<T> values)
Checks if any of the values are not in an ascending order. |
|
static
|
areNotInAscendingOrder(T... values)
Checks if any of the values are not in an ascending order. |
|
static
|
elementIsContainedInArray(T element,
T... values)
Checks if the element is contained within the list of values. |
|
static
|
elementIsContainedInList(T element,
Collection<T> values)
Checks if the element is contained within the list of values. |
|
static
|
elementIsNotContainedInArray(T element,
T... values)
Checks if the element is contained within the list of values. |
|
static
|
elementIsNotContainedInList(T element,
Collection<T> values)
Checks if the element is not contained within the list of values. |
|
static
|
max(T obj1,
T obj2)
Returns any element if obj1.compareTo(obj2) == 0 |
|
static
|
min(T obj1,
T obj2)
Returns any element if obj1.compareTo(obj2) == 0 |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompareUtil()
| Method Detail |
|---|
public static <T extends Comparable<T>> boolean areNotInAscendingOrder(T... values)
Comparable.compareTo(Object) method.
E.g. if we have minPriority = 10, priority = 13 and maxPriority = 5 and
Integer[] values = {minPriority, priority, maxPriority}. Then a call to areNotInAscendingOrder(Comparable[] values)
will return true
T - the type of the comparablevalues - to validate
false if the not null values are in an ascending order or all the values are null, true otherwisepublic static <T extends Comparable<T>> boolean areNotInAscendingOrder(List<T> values)
Comparable.compareTo(Object) method.
E.g. if we have minPriority = 10, priority = 13 and maxPriority = 5 and
List<Integer> values = {minPriority, priority, maxPriority}. Then a call to areNotInAscendingOrder(List values)
will return true
T - the type of the comparablevalues - to validate
false if the not null values are in an ascending order or all the values are null, true otherwise
public static <T> boolean elementIsNotContainedInList(T element,
Collection<T> values)
T - the type of the elementelement - to checkvalues - to check in
true if the element and values are not null and the values does not contain the element, false otherwise
public static <T> boolean elementIsNotContainedInArray(T element,
T... values)
T - the type of the elementelement - to checkvalues - to check in
true if the element and values are not null and the values does not contain the element, false otherwise
public static <T> boolean elementIsContainedInList(T element,
Collection<T> values)
T - the type of the elementelement - to checkvalues - to check in
true if the element and values are not null and the values contain the element,
false otherwise
public static <T> boolean elementIsContainedInArray(T element,
T... values)
T - the type of the elementelement - to checkvalues - to check in
true if the element and values are not null and the values contain the element,
false otherwise
public static <T extends Comparable<T>> T min(T obj1,
T obj2)
public static <T extends Comparable<T>> T max(T obj1,
T obj2)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||