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

restx.entity.EntityRequestBodyReaderRegistryFactoryMachine Maven / Gradle / Ivy

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

import com.google.common.collect.ImmutableSet;
import restx.factory.*;
import restx.entity.EntityRequestBodyReaderRegistry;

@Machine
public class EntityRequestBodyReaderRegistryFactoryMachine extends SingleNameFactoryMachine {
    public static final Name NAME = Name.of(restx.entity.EntityRequestBodyReaderRegistry.class, "EntityRequestBodyReaderRegistry");

    public EntityRequestBodyReaderRegistryFactoryMachine() {
        super(0, new StdMachineEngine(NAME, 0, BoundlessComponentBox.FACTORY) {
private final Factory.Query entityDefaultContentTypeProviders = Factory.Query.byClass(restx.entity.EntityDefaultContentTypeProvider.class).optional();
private final Factory.Query entityRequestBodyReaderFactories = Factory.Query.byClass(restx.entity.EntityRequestBodyReaderFactory.class).optional();

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

            @Override
            protected restx.entity.EntityRequestBodyReaderRegistry doNewComponent(SatisfiedBOM satisfiedBOM) {
                return new EntityRequestBodyReaderRegistry(
satisfiedBOM.getAsComponents(entityDefaultContentTypeProviders),
satisfiedBOM.getAsComponents(entityRequestBodyReaderFactories)
                );
            }
        });
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy