Package com.amazon.ion.util
Class Equivalence.Builder
java.lang.Object
com.amazon.ion.util.Equivalence.Builder
- Enclosing class:
Equivalence
Constructs
Equivalence instances. To compare IonValues using an
Equivalence instance's configuration, call Equivalence.ionValueEquals(IonValue, IonValue)
on that instance rather than calling IonValue.equals(Object).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()withEpsilon(double epsilon) The maximum absolute difference between two Ion float values for which the two values will be considered equivalent.withMaxComparisonDepth(int maxComparisonDepth) The maximum depth to which two values will be compared.withStrict(boolean isStrict) When true, checks for strict data equivalence over two Ion Values.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withStrict
When true, checks for strict data equivalence over two Ion Values. When false, checks for structural data equivalence over two Ion Values. SeeEquivalencefor discussion of the differences between the two. Default: true.- Parameters:
isStrict- the value.- Returns:
- this builder.
-
withEpsilon
The maximum absolute difference between two Ion float values for which the two values will be considered equivalent. Default: Ion float values will only be considered equivalent whenDouble.compare(a, b) == 0.- Parameters:
epsilon- the value.- Returns:
- this builder.
-
withMaxComparisonDepth
The maximum depth to which two values will be compared. If the two values to be compared are still potentially equivalent beyond this depth,Equivalence.ionValueEquals(IonValue, IonValue)will throw anIonException.- Parameters:
maxComparisonDepth- the value.- Returns:
- this builder.
-
build
- Returns:
- a new Equivalence using this builder's configuration.
-