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

io.swagger.jaxrs.config.DefaultReaderConfig Maven / Gradle / Ivy

There is a newer version: 1.6.14
Show newest version
package io.swagger.jaxrs.config;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;

/**
 * The ReaderConfig interface defines configuration settings for
 * JAX-RS annotations reader.
 */
public class DefaultReaderConfig implements ReaderConfig {
    private boolean scanAllResources;
    private Collection ignoredRoutes = Collections.emptySet();

    /**
     * Creates default configuration.
     */
    public DefaultReaderConfig() {
    }

    /**
     * Creates a copy of passed configuration.
     */
    public DefaultReaderConfig(ReaderConfig src) {
        if (src == null) {
            return;
        }
        setScanAllResources(src.isScanAllResources());
        setIgnoredRoutes(src.getIgnoredRoutes());
    }

    @Override
    public boolean isScanAllResources() {
        return scanAllResources;
    }

    public void setScanAllResources(boolean scanAllResources) {
        this.scanAllResources = scanAllResources;
    }

    @Override
    public Collection getIgnoredRoutes() {
        return ignoredRoutes;
    }

    public void setIgnoredRoutes(Collection ignoredRoutes) {
        this.ignoredRoutes = ignoredRoutes == null || ignoredRoutes.isEmpty() ? Collections.emptySet()
                : Collections.unmodifiableCollection(new HashSet(ignoredRoutes));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy