org.mentacontainer.impl.ConstructorDependency Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of menta-container Show documentation
Show all versions of menta-container Show documentation
A IOC container as simple and pragmatic as it can get with programmatic configuration through a Fluent API.
package org.mentacontainer.impl;
/**
* A simple implementation of the Dependency interface.
*
* @author [email protected]
*/
class ConstructorDependency {
private final String sourceFromContainer;
private final Class> sourceType;
public ConstructorDependency(String sourceFromContainer, Class> sourceType) {
this.sourceFromContainer = sourceFromContainer;
this.sourceType = sourceType;
}
public String getSource() {
return sourceFromContainer;
}
public Class> getSourceType() {
return sourceType;
}
@Override
public int hashCode() {
return sourceFromContainer.hashCode();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ConstructorDependency)) return false;
ConstructorDependency d = (ConstructorDependency) obj;
if (!d.sourceFromContainer.equals(this.sourceFromContainer)) return false;
return true;
}
@Override
public String toString() {
return "[ConstructorDependency: sourceFromContainer=" + sourceFromContainer + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy