Package org.apache.thrift.partial
Class PartialThriftComparer<T extends TBase>
java.lang.Object
org.apache.thrift.partial.PartialThriftComparer<T>
Enables comparison of two TBase instances such that the comparison is limited to the subset of
fields defined by the supplied metadata.
This comparer is useful when comparing two instances where: -- one is generated by full deserialization. -- the other is generated by partial deserialization.
The typical use case is to establish correctness of partial deserialization.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareEqual(T t1, T t2, StringBuilder sb) Compares thrift objectst1andt2and returns true if they are equal false otherwise.
-
Constructor Details
-
PartialThriftComparer
Constructs an instance ofPartialThriftComparer.- Parameters:
metadata- defines the scope of comparison.
-
-
Method Details
-
areEqual
Compares thrift objectst1andt2and returns true if they are equal false otherwise. The comparison is limited to the scope defined bymetadata.If the objects are not equal then it optionally records their differences if
sbis supplied.- Parameters:
t1- the first object.t2- the second object.sb- if non-null, results of the comparison are returned in it.- Returns:
- true if objects are equivalent, false otherwise.
-