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

com.github.taccisum.swagger.configurer.util.PathsUtil Maven / Gradle / Ivy

The newest version!
package com.github.taccisum.swagger.configurer.util;

import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import springfox.documentation.builders.PathSelectors;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author tac - [email protected]
 * @since 2019/2/12
 */
public abstract class PathsUtil {
    public static Predicate includeAndExclude(List includePaths, List excludePaths) {
        return Predicates.and(
                Predicates.or(includePaths.stream().map(PathSelectors::ant).collect(Collectors.toList())),
                Predicates.not(Predicates.or(excludePaths.stream().map(PathSelectors::ant).collect(Collectors.toList())))
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy