Hi,
all builder classes share common properties, e.g. the constructor or build function.
final public AccessTokenRequestMessage build() throws ConstraintViolationException {
VocabUtil.getInstance().validate(accessTokenRequestMessageImpl);
return accessTokenRequestMessageImpl;
}
I would like to propose a common interface used for all Builder classes.
Something like
public interface Builder<T>{
T build() throws ConstraintViolationException;
}
By using this interface it would be possible to use the builder independent from the concrete type they are constructing.
This independence would mean it would be possible to implement common interactions such as error handling in a generic way.