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

cat.nyaa.nyaacore.component.ComponentDuplicatedException Maven / Gradle / Ivy

There is a newer version: 3.12.2
Show newest version
package cat.nyaa.nyaacore.component;

public class ComponentDuplicatedException extends RuntimeException {
    private final Class componentInterface;
    private final IComponent registeredImplementation;
    private final IComponent incomingImplementation;

    public ComponentDuplicatedException(Class componentInterface, IComponent registeredImplementation, IComponent incomingImplementation) {
        this.componentInterface = componentInterface;
        this.registeredImplementation = registeredImplementation;
        this.incomingImplementation = incomingImplementation;
    }

    public Class getComponentInterface() {
        return componentInterface;
    }

    public IComponent getRegisteredImplementation() {
        return registeredImplementation;
    }

    public IComponent getIncomingImplementation() {
        return incomingImplementation;
    }

    @Override
    public String toString() {
        return String.format("Interface %s is already registered by %s but gets registered again by %s",
                componentInterface,
                registeredImplementation,
                incomingImplementation);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy