Class PartialThriftComparer<T extends TBase>

java.lang.Object
org.apache.thrift.partial.PartialThriftComparer<T>

public class PartialThriftComparer<T extends TBase> extends Object
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 Details

  • Method Details

    • areEqual

      public boolean areEqual(T t1, T t2, StringBuilder sb)
      Compares thrift objects t1 and t2 and returns true if they are equal false otherwise. The comparison is limited to the scope defined by metadata.

      If the objects are not equal then it optionally records their differences if sb is 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.