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

com.cookingfox.chefling.impl.command.HasInstanceOrMappingCommandImpl Maven / Gradle / Ivy

Go to download

Chefling is a very minimal dependency injection container written in pure Java.

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