/** * Creates the instance of {@code Error} with the supplied configuration. * * All builder parameters are required except for the error message which may be null. * * @return the error instance */ public Error build() { checkState(exception != null, "error exception cannot be null"); checkState(description != null, "description exception cannot be null"); checkState(detailedDescription != null, "detailed description exception cannot be null"); checkState(errorType != null, "errorType exception cannot be null"); return new ErrorImplementation(exception, description, detailedDescription, errorType, errorMessage, errors); }