
com.cookingfox.chefling.impl.command.HasInstanceOrMappingCommandImpl 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.impl.command;
import com.cookingfox.chefling.api.command.HasInstanceOrMappingCommand;
import com.cookingfox.chefling.impl.helper.CommandContainerMatcher;
/**
* @see HasInstanceOrMappingCommand
*/
public class HasInstanceOrMappingCommandImpl extends AbstractCommand implements HasInstanceOrMappingCommand {
//----------------------------------------------------------------------------------------------
// CONSTRUCTORS
//----------------------------------------------------------------------------------------------
public HasInstanceOrMappingCommandImpl(CommandContainer container) {
super(container);
}
//----------------------------------------------------------------------------------------------
// PUBLIC METHODS
//----------------------------------------------------------------------------------------------
@Override
public boolean hasInstanceOrMapping(Class type) {
CommandContainerMatcher matcher = HasMappingMatcher.get(type);
return matcher.matches(_container) || findOne(_container, matcher) != null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy