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

net.nemerosa.ontrack.model.extension.ExtensionCycleException Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.extension;

import net.nemerosa.ontrack.common.BaseException;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.stream.Collectors;

public class ExtensionCycleException extends BaseException {
    public ExtensionCycleException(List> cycles) {
        super("There is a cycle of dependencies between the extensions:%n%s", displayCycles(cycles));
    }

    private static String displayCycles(List> cycles) {
        return cycles.stream()
                .map(ExtensionCycleException::displayCycle)
                .collect(Collectors.joining("\n"));
    }

    private static String displayCycle(List sub) {
        return StringUtils.join(sub, " -> ");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy