Bean matcher classes

PolicyCenter provides the bean matcher class gw.api.diff.PCBeanMatcher. Most entity types implement one of the matcher delegates and do not have explicit code in PCBeanMatcher. The PCBeanMatcher class contains code to match only a few entity types, most notably including Cost objects.

The policy difference system always initially uses a PCBeanMatcher object to perform the base comparison of the Id property and, for effective-dated subobjects in a PolicyPeriod graph, the FixedID property. Similarly, the PolicyCenter out-of-sequence handling system initially calls PCBeanMatcher methods.

This class compares two objects and determines if they are equal by performing the following checks:

  • Comparing the object references for equality
  • Comparing the fixedID property
  • Using the delegate-based matcher isLogicalMatchUntyped method
  • For a very few entity types, comparing specific property values

If any one of these checks returns a value of true, the two entity instances are the same and the bean matcher performs no further checks.

If two entity instances have the same fixed ID (fixedID property), those entity instances represent the same item. If the fixed IDs do not match, PolicyCenter performs additional checks. For example, two cars are the same if their vehicle identification numbers (VINs) match.

These comparisons are typically performed by the delegate-based matcher method that the bean matcher calls. The matchers that PolicyCenter entity types provide handle common cases. However, you can customize the logic in the delegate-based matcher to support your business needs.