restx.specs.StorageSettingsConfigFactoryMachine Maven / Gradle / Ivy
package restx.specs;
import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.specs.RestxSpec.StorageSettingsConfig;
@Machine
public class StorageSettingsConfigFactoryMachine extends SingleNameFactoryMachine {
public static final Name NAME = Name.of(restx.specs.RestxSpec.StorageSettingsConfig.class, "StorageSettingsConfig");
public StorageSettingsConfigFactoryMachine() {
super(0, new StdMachineEngine(NAME, 0, 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.specs.RestxSpec.StorageSettingsConfig doNewComponent(SatisfiedBOM satisfiedBOM) {
return new StorageSettingsConfig(
satisfiedBOM.getOne(config).get().getComponent()
);
}
});
}
}