public class PdfDictionaryEqualityCalculator extends Object
PdfDictionary
. It allows to
provide a list of rules. According to the rules dictionary will be processed appropriately before
hash or equality calculation.
According to the contract of IValueUpdateRule
it is expected that rule applying should
not change the internal state of the objects included as values into original PdfDictionary.
Modified copies of the objects will be put into dictionary instead.
Constructor and Description |
---|
PdfDictionaryEqualityCalculator(List<IValueUpdateRule> rules)
Creates a new instance of the class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areEqual(com.itextpdf.kernel.pdf.PdfDictionary dict1,
com.itextpdf.kernel.pdf.PdfDictionary dict2)
Applies rules passed to constructor
PdfDictionaryEqualityCalculator(List) to both
provided dictionaries and then compares them using
EqualityUtils.areEqual(PdfObject, PdfObject) method. |
int |
getHashCode(com.itextpdf.kernel.pdf.PdfDictionary dict)
Applies rules passed to constructor
PdfDictionaryEqualityCalculator(List) to provided
dictionary and then calculates its hash code using EqualityUtils.getHashCode(PdfObject)
method. |
public PdfDictionaryEqualityCalculator(List<IValueUpdateRule> rules)
rules
- is a list of rules for PdfDictionary
processingpublic int getHashCode(com.itextpdf.kernel.pdf.PdfDictionary dict)
PdfDictionaryEqualityCalculator(List)
to provided
dictionary and then calculates its hash code using EqualityUtils.getHashCode(PdfObject)
method.
For the same set of rules two instances will have equal hashCode if they are considered
as equal by areEqual(PdfDictionary, PdfDictionary)
method.
dict
- is a dictionary whose content-based hash code has to be calculatedpublic boolean areEqual(com.itextpdf.kernel.pdf.PdfDictionary dict1, com.itextpdf.kernel.pdf.PdfDictionary dict2)
PdfDictionaryEqualityCalculator(List)
to both
provided dictionaries and then compares them using
EqualityUtils.areEqual(PdfObject, PdfObject)
method.
For the same set of rules if two instances are considered as equal they should also have
equals hashCodes calculated by
getHashCode(PdfDictionary)
method.
dict1
- is the first dictionary to comparedict2
- is the second dictionary to compareCopyright © 1998–2024 iText Group NV. All rights reserved.