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

org.mentacontainer.impl.ConstructorDependency Maven / Gradle / Ivy

Go to download

A IOC container as simple and pragmatic as it can get with programmatic configuration through a Fluent API.

There is a newer version: 1.2.6
Show newest version
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