public class Objects extends Object
Constructor and Description |
---|
Objects() |
Modifier and Type | Method and Description |
---|---|
static boolean |
deepEquals(Object a,
Object b,
double epsilon)
Returns
true if the arguments are deeply equal with a tolerable
error to each other and false otherwise. |
static boolean |
equals(Object a,
Object b,
double epsilon)
Returns
true if the arguments are equal to each other with
a tolerable error and false otherwise. |
static boolean |
equalsIgnoreCase(Collection<String> a,
Collection<String> b)
Returns
true if the arguments are equal to each other while
ignoring case when comparing their elements and false otherwise. |
public static boolean equalsIgnoreCase(Collection<String> a, Collection<String> b)
true
if the arguments are equal to each other while
ignoring case when comparing their elements and false
otherwise.
Consequently, if both arguments are null
, true
is returned and if exactly one argument is null
,
false
is returned. Otherwise, equality is determined by converting
each element to its lower case representation and comparing.
Note: Only sets and lists are currently supported.
a
- a collection of stringsb
- another collection of strings to be compared with a
for equality while ignoring casetrue
if the arguments are equal to each other while
ignoring case when comparing their elements and false
otherwisepublic static boolean equals(Object a, Object b, double epsilon)
true
if the arguments are equal to each other with
a tolerable error and false
otherwise.
Consequently, if both arguments are null
, true
is returned and if exactly one argument is null
,
false
is returned. Otherwise, equality is determined by using
the Object.equals(java.lang.Object)
method or the Tolerable.equals(java.lang.Object, double)
method of
the first argument.
a
- an objectb
- an object to be compared with a
for equalityepsilon
- the tolerable errortrue
if the arguments are equal to each other with a
tolerable error and false
otherwiseObject.equals(Object)
,
Tolerable.equals(java.lang.Object, double)
public static boolean deepEquals(Object a, Object b, double epsilon)
true
if the arguments are deeply equal with a tolerable
error to each other and false
otherwise.
Two null
values are deeply equal. If both arguments are
arrays, the algorithm in Arrays.deepEquals(Object[], Object[], double)
is used to determine equality. Otherwise, equality is determined by using
the Object.equals(java.lang.Object)
or Tolerable.equals(java.lang.Object, double)
method of the first
argument.
a
- an objectb
- an object to be compared with a
for deep equalityepsilon
- the tolerable errortrue
if the arguments are deeply equal to each other
with a tolerable error and false
otherwiseArrays.deepEquals(Object[], Object[], double)
,
equals(Object, Object, double)
Copyright (C) 2015-2017 The Helenus Driver Project Authors.