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

org.jboss.resteasy.reactive.server.model.Features Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.server.model;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

import jakarta.ws.rs.core.Feature;

import org.jboss.resteasy.reactive.common.model.ResourceFeature;
import org.jboss.resteasy.reactive.spi.BeanFactory;

public class Features {

    private final List resourceFeatures = new ArrayList<>();

    public void addFeature(ResourceFeature resourceFeature) {
        resourceFeatures.add(resourceFeature);
    }

    public List getResourceFeatures() {
        return resourceFeatures;
    }

    public void initializeDefaultFactories(Function> factoryCreator) {
        for (ResourceFeature i : resourceFeatures) {
            if (i.getFactory() == null) {
                i.setFactory((BeanFactory) factoryCreator.apply(i.getClassName()));
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy