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

samplest.hello.FactoryInjectionResourceFactoryMachine Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package samplest.hello;

import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import samplest.hello.FactoryInjectionResource;

@Machine
public class FactoryInjectionResourceFactoryMachine extends SingleNameFactoryMachine {
    public static final Name NAME = Name.of(samplest.hello.FactoryInjectionResource.class, "FactoryInjectionResource");

    public FactoryInjectionResourceFactoryMachine() {
        super(0, new StdMachineEngine(NAME, 0, BoundlessComponentBox.FACTORY) {
private final Factory.Query testSetInjection = Factory.Query.byClass(samplest.hello.TestSetInjection.class).optional();
private final Factory.Query testSetAbstract = Factory.Query.byClass(samplest.hello.TestSetAbstract.class).optional();

            @Override
            public BillOfMaterials getBillOfMaterial() {
                return new BillOfMaterials(ImmutableSet.>of(
testSetInjection,
testSetAbstract
                ));
            }

            @Override
            protected samplest.hello.FactoryInjectionResource doNewComponent(SatisfiedBOM satisfiedBOM) {
                return new FactoryInjectionResource(
com.google.common.collect.Sets.newLinkedHashSet(satisfiedBOM.getAsComponents(testSetInjection)),
com.google.common.collect.Sets.newLinkedHashSet(satisfiedBOM.getAsComponents(testSetAbstract))
                );
            }
        });
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy