restx.AppSettingsConfigFactoryMachine Maven / Gradle / Ivy
package restx;
import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.AppSettingsConfig;
@Machine
public class AppSettingsConfigFactoryMachine extends SingleNameFactoryMachine {
public static final Name NAME = Name.of(restx.AppSettingsConfig.class, "AppSettingsConfig");
public AppSettingsConfigFactoryMachine() {
super(1000, new StdMachineEngine(NAME, 1000, BoundlessComponentBox.FACTORY) {
private final Factory.Query config = Factory.Query.byClass(restx.common.RestxConfig.class).mandatory();
@Override
public BillOfMaterials getBillOfMaterial() {
return new BillOfMaterials(ImmutableSet.>of(
config
));
}
@Override
protected restx.AppSettingsConfig doNewComponent(SatisfiedBOM satisfiedBOM) {
return new AppSettingsConfig(
satisfiedBOM.getOne(config).get().getComponent()
);
}
});
}
}