A PropertiesDiscriminator discriminates any objects based on values from a given set of property names. jAgg uses a PropertiesDiscriminator when grouping by certain property names during aggregation. This Discriminator discriminates objects by calling the object's methods that correspond to the property names and then discriminating on the results of those method calls. It delegates to other Discriminators, based on the return types of those methods.
A PropertiesDiscriminator is used by a DiscriminableDiscriminator, after it determines the list of properties to discriminate.
Given the class...
public class Widget { private int a; private int b; public Widget(int a, int b) {this.a = a; this.b = b;} public int getA() { return a; } public int getB() { return b; } public int getResult() { return a + b; } }
... and the input...
... a PropertiesDiscriminator(Arrays.asList("result")) returns the following equivalence classes: