public final class Equivalence extends Object
IonValues, following
the contract of IonValue.equals(Object).
Basic usage of this class is as follows:
IonValue v1 = ...;
IonValue v2 = ...;
software.amazon.ion.util.Equivalence.ionEquals( v1, v2 );
More likely, a static import would make using this class easier.
import static software.amazon.ion.util.Equivalence.ionEquals;
...
boolean equivalent = ionEquals( v1, v2 );
Additional options are available by configuring an Equivalence
instance using Equivalence.Builder. For example:
software.amazon.ion.util.Equivalence equivalence =
new software.amazon.ion.util.Equivalence.Builder()
.withEpsilon(1e-6)
.build();
IonValue v1 = ...;
IonValue v2 = ...;
equivalence.ionValueEquals( v1, v2 );
| Modifier and Type | Class and Description |
|---|---|
static class |
Equivalence.Builder
Constructs
Equivalence instances. |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
ionEquals(IonValue v1,
IonValue v2)
Checks for strict data equivalence over two Ion Values.
|
static boolean |
ionEqualsByContent(IonValue v1,
IonValue v2)
Checks for structural data equivalence over two Ion Values.
|
boolean |
ionValueEquals(IonValue v1,
IonValue v2)
Checks for data equivalence over two Ion values using this Equivalence's
configuration
|
public static boolean ionEquals(IonValue v1, IonValue v2)
v1 - The first Ion value to compare.v2 - The second Ion value to compare.public static boolean ionEqualsByContent(IonValue v1, IonValue v2)
v1 - The first Ion value to compare.v2 - The second Ion value to compare.public boolean ionValueEquals(IonValue v1, IonValue v2)
v1 - The first Ion value to compare.v2 - The second Ion value to compare.Equivalence.Builder