org.mentacontainer.impl.SingletonFactory 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;
import org.mentacontainer.Factory;
public class SingletonFactory implements Factory {
private final Object instance;
private final Class> type;
public SingletonFactory(Object instance) {
this.instance = instance;
this.type = instance.getClass();
}
@Override
public T getInstance() {
return (T) instance;
}
@Override
public Class> getType() {
return type;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy