cat.nyaa.nyaacore.component.ComponentDuplicatedException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rpgitems Show documentation
Show all versions of rpgitems Show documentation
The legacy RPGItems continues. (fork)
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);
}
}