package org.opendaylight.restconf.common.errors;
import com.google.common.base.Preconditions;
-import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import java.util.Collection;
private static final long serialVersionUID = 1L;
- private final List<RestconfError> errors;
+ private final ImmutableList<RestconfError> errors;
private final Status status;
/**
* Constructs an instance with the given RpcErrors.
*/
public RestconfDocumentedException(final String message, final Throwable cause,
- final Collection<RpcError> rpcErrors) {
+ final Collection<? extends RpcError> rpcErrors) {
this(message, cause, convertToRestconfErrors(rpcErrors));
}
status = null;
}
- private static List<RestconfError> convertToRestconfErrors(final Collection<RpcError> rpcErrors) {
+ private static List<RestconfError> convertToRestconfErrors(final Collection<? extends RpcError> rpcErrors) {
final List<RestconfError> errorList = Lists.newArrayList();
if (rpcErrors != null) {
for (RpcError rpcError : rpcErrors) {