com.github.davidmoten.oas3.internal.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-to-plantuml Show documentation
Show all versions of openapi-to-plantuml Show documentation
Generates PlantUML file from an OpenAPI 3.0 Definition
The newest version!
package com.github.davidmoten.oas3.internal;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
public final class Util {
private Util() {
// prevent instantiation
}
public static Map nullMapToEmpty(Map map) {
if (map == null) {
return Collections.emptyMap();
} else {
return map;
}
}
public static List nullListToEmpty(List list) {
if (list == null) {
return Collections.emptyList();
} else {
return list;
}
}
public static Optional> first(Map map) {
return map.entrySet().stream().findFirst();
}
public static String quote(String s) {
return "\"" + s + "\"";
}
}