orika-mapper/orika — pull request #13 by matt-deboer (2013-06-29 21:27:59+00:00)
Title: Initial implementation of Expectations; can be used to explicitly

Expectation allows the user to declare expected results about how fields are mapped.

For example:

```
factory.classMap(Source.class, Destination.class)
.fieldAToB("lastName", "name.last")
.exclude("age")
.byDefault()
.expectMappedOnB(FieldSet.noneOf("name.first", "age"))
.register();
```
specifies that _none of_ "name.first" or "age" should have been mapped on the destination type.
The corresponding method **expectMappedOnA()** can be used for setting expectations in the reverse direction.

_**FieldSet**_ supports the following static methods to describe the set of fields that should be mapped:
* all() : specifies that all fields including nested fields should be mapped
* allNonNested() : specifies that all non-nested fields should be mapped
* allExcept(String...fields) : specifies that all fields other than the specified exclusions should be mapped
* allNonNestedExcept(String...fields) : specifies that all non-nested fields other that the specified exclusions should be mapped
* noneOf(String...fields) : specifies that none of the specified excluded fields should be mapped
* only(String...fields) : specifies that only the fields explicitly specified should be mapped

During the initialization process (on the first call to getMapperFacade()), the expectations are evaluated. A **FailedExpectationException** is thrown if any declared expectation is not satisfied.

*Keep in mind that these are expectations about the code that is generated, not about any particular result achieved at runtime.*