Previous detailUpNext detail
Detail 6.1Detail 6.1.2

Detail 6.1.1: Variations on exact match

Exact match

This predicate is the most basic one: do two field values match exactly? The predicate can be applied to Java Numbers, Dates, Strings or any other Java Object. The test that is applied is the Object.equals(Object) method, or its redefinition by a subclass. (If one but not both of the field values is null, the predicate tests false. If both field values are null, the predicate may be customized to return either true or false, depending on the application requirements. The default behavior is to treat two nulls as different values.) As an example, consider the application of this predicate to a String field. The predicate will return only if the two String values match right down to the capitalization of the letters that compose the values and the amount of whitespace padding (if any) that surrounds the "core" of the values.

Basic construction:

  String name = "somePredicateName";
  Method m = Cdc1Record.class.getMethod("getLastName", (Class<?>[])null);
  Set<?> s = null;
  Predicate<Cdc1Record> p = new ExactMatchPredicate<EXPORT_TYPE_JAVA, Cdc1Record>(name, m, s);

Please note that the parameter type EXPORT_TYPE_JAVA and the constructor argument s are not relevant to pair synthesis and are not discussed here. They should be used as shown. (For more details, see the ChoiceMaker API.)

Trimmed, lower-case Strings

Trimmed, lower-case Substrings

Longest common substring

Longest common subsequence


Previous detailUpNext detail
Detail 6.1Detail 6.1.2