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

org.meridor.stecker.PluginException Maven / Gradle / Ivy

Go to download

This is a plugin loading library. Its main purpose is to load extension point implementations from provided plugins.

There is a newer version: 1.0.2
Show newest version
package org.meridor.stecker;

import org.meridor.stecker.interfaces.DependencyProblem;

import java.util.Optional;

/**
 * An generic exception thrown when something goes wrong with plugins
 */
public class PluginException extends Exception {

    private Optional dependencyProblem = Optional.empty();

    private Optional pluginMetadata = Optional.empty();

    public PluginException(Exception e) {
        super(e);
    }

    public PluginException(String message) {
        super(message);
    }

    public PluginException(String message, Exception e) {
        super(message, e);
    }

    public PluginException withDependencyProblem(DependencyProblem dependencyProblem) {
        this.dependencyProblem = Optional.ofNullable(dependencyProblem);
        return this;
    }

    public PluginException withPlugin(PluginMetadata pluginMetadata) {
        this.pluginMetadata = Optional.ofNullable(pluginMetadata);
        return this;
    }

    /**
     * Returns dependency problem if any
     *
     * @return dependency problem
     */
    public Optional getDependencyProblem() {
        return dependencyProblem;
    }

    /**
     * Returns plugin affected
     *
     * @return plugin metadata
     */
    public Optional getPluginMetadata() {
        return pluginMetadata;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy