use of org.n52.janmayen.exception.CompositeException in project arctic-sea by 52North.
the class AbstractKvpDecoder method decode.
@Override
public R decode(Map<String, String> parameters) throws DecodingException {
if (parameters == null) {
throw new DecodingException("The request does not contain any parameter!");
}
CompositeException exceptions = new CompositeException();
R request = this.supplier.get();
parameters.forEach(exceptions.wrapConsumer(getDecoder(new Builder<R>().add(this::getCommonRequestParameterDefinitions).add(this::getRequestParameterDefinitions).build()).curryFirst(request)));
if (exceptions.hasExceptions()) {
throw new DecodingException(exceptions);
}
return request;
}
Aggregations