AbstractSpecification2

Adapter to make it easy to write Specification s.

Provides two main features:

  • first, is type-safe (with invalid type being either ignored or constituting a failure), and

  • second, checks for nulls (with a null either being ignore or again constituting a failure)

Implementation note: inspired by (borrowed code from) Hamcrest’s TypeSafeMatcher .

API

AbstractSpecification2.java
class AbstractSpecification2<T> {
  String satisfies(Object obj)
  TranslatableString satisfiesTranslatable(Object obj)     (1)
}
1 satisfiesTranslatable(Object)

Checks not null and is correct type, and delegates to #satisfiesTranslatableSafely(Object) .

Members

satisfiesTranslatable(Object)

Checks not null and is correct type, and delegates to #satisfiesTranslatableSafely(Object) .