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

restx.specs.SpecModuleFactoryMachine Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.specs;

import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.specs.SpecModule;


@Machine
public class SpecModuleFactoryMachine extends DefaultFactoryMachine {
    private static final SpecModule module = new SpecModule();

    public SpecModuleFactoryMachine() {
        super(0, new MachineEngine[] {
            new StdMachineEngine(Name.of(restx.config.ConfigSupplier.class, "specConfigSupplier"), 0, BoundlessComponentBox.FACTORY) {
        private final Factory.Query configLoader = Factory.Query.byClass(restx.config.ConfigLoader.class).mandatory();
                @Override
                public BillOfMaterials getBillOfMaterial() {
                    return new BillOfMaterials(ImmutableSet.>of(
        configLoader
                    ));
                }

                @Override
                public restx.config.ConfigSupplier doNewComponent(SatisfiedBOM satisfiedBOM) {
	                    return module.specConfigSupplier(
	        satisfiedBOM.getOne(configLoader).get().getComponent()
	                    );
                }
            },

        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy