All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coursierapi.error.MultipleResolutionError Maven / Gradle / Ivy

package coursierapi.error;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class MultipleResolutionError extends ResolutionError {

    private final List errors;

    private MultipleResolutionError(List errors, String message) {
        super(message);
        this.errors = Collections.unmodifiableList(errors);
    }

    public static MultipleResolutionError of(SimpleResolutionError error, SimpleResolutionError... errors) {
        List errors0 = new ArrayList<>();
        errors0.add(error);
        errors0.addAll(Arrays.asList(errors));

        StringBuilder b = new StringBuilder();
        for (SimpleResolutionError error0 : errors0) {
            b.append(error0.getMessage());
            b.append('\n');
        }

        return new MultipleResolutionError(errors0, b.toString());
    }

    public List getErrors() {
        return errors;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy