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

com.getyourguide.openapi.validation.util.CommaSeparatedStringsUtil Maven / Gradle / Ivy

The newest version!
package com.getyourguide.openapi.validation.util;

import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class CommaSeparatedStringsUtil {

    public static Set convertCommaSeparatedStringToSet(String excludedPaths) {
        if (excludedPaths == null || excludedPaths.isEmpty()) {
            return Set.of();
        }

        return Stream.of(excludedPaths.trim().split(",")).map(String::trim).filter(excludedPath -> !excludedPath.isEmpty()).collect(Collectors.toSet());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy