@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ExternalDomain
Domain annotated class.
The annotated class must implement DomainConverter.
In the bellow code, the SalaryConverter class handles the Salary class as a Domain
annotated class:
@ExternalDomain
public class SalaryConverter implements DomainConverter<Salary, BigDecimal> {
public BigDecimal fromDomainToValue(Salary domain) {
return domain.getValue();
}
public Salary fromValueToDomain(BigDecimal value) {
return new Salary(value);
}
}
The annotated instance is required to be thread safe.
DomainConverter,
DomainConverters