
com.cookingfox.chefling.api.command.GetInstanceCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chefling-di-java Show documentation
Show all versions of chefling-di-java Show documentation
Chefling is a very minimal dependency injection container written in pure Java.
package com.cookingfox.chefling.api.command;
import com.cookingfox.chefling.api.CheflingContainer;
import com.cookingfox.chefling.api.exception.ContainerException;
public interface GetInstanceCommand {
/**
* Returns an instance of `type`. If a previously stored instance exists, it will always return
* that same instance. If there is no stored instance, it will create a new one using
* {@link CheflingContainer#createInstance(Class)}, and store and return that.
*
* @param type The type (class, interface) of the object you want to retrieve.
* @param Ensures the returned object is cast to the expected type.
* @return Instance of `type`.
* @throws ContainerException when an instance of the type cannot be created.
*/
T getInstance(Class type);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy