MentaContainer

Compare Revisions

Ignore whitespace Rev 40 → Rev 41

/trunk/src/main/java/org/mentacontainer/impl/MentaContainer.java
25,7 → 25,7
 
private Set<Dependency> dependencies = new HashSet<Dependency>();
 
public Object get(String key) {
public <T> T get(String key) {
 
if (!beans.containsKey(key)) throw new RuntimeException("Container does not have this bean set: " + key);
 
41,7 → 41,7
 
target = singletons.get(key);
 
return target;
return (T) target;
 
} else {
 
100,7 → 100,7
}
}
 
return target; // return target nicely with all the dependencies
return (T) target; // return target nicely with all the dependencies
 
} catch (Exception e) {