AbstractSpecification

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

AbstractSpecification.java
class AbstractSpecification<T> {
  String satisfies(Object obj)     (1)
}
1 satisfies(Object)

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

Members

satisfies(Object)

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