|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.applib.spec.AbstractSpecification<T>
public abstract class AbstractSpecification<T>
Adapter to make it easy to write Specifications.
Provides two main features:
Implementation note: inspired by (borrowed code from) Hamcrest's TypeSafeMatcher.
| Nested Class Summary | |
|---|---|
static class |
AbstractSpecification.Nullability
|
static class |
AbstractSpecification.TypeChecking
|
| Constructor Summary | |
|---|---|
protected |
AbstractSpecification()
|
protected |
AbstractSpecification(AbstractSpecification.Nullability nullability,
AbstractSpecification.TypeChecking typeChecking)
|
| Method Summary | |
|---|---|
String |
satisfies(Object obj)
Checks not null and is correct type, and delegates to satisfiesSafely(Object). |
abstract String |
satisfiesSafely(T obj)
If null then satisfied, otherwise is reason why the specification is not satisfied. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractSpecification()
protected AbstractSpecification(AbstractSpecification.Nullability nullability,
AbstractSpecification.TypeChecking typeChecking)
| Method Detail |
|---|
public final String satisfies(Object obj)
satisfiesSafely(Object).
satisfies in interface Specificationpublic abstract String satisfiesSafely(T obj)
Subclasses should implement this. The item will already have been checked for the specific type and will never be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||