public final class YAMLUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
parserObject(String yamlContent,
Class<T> clazz) |
static Map<String,Object> |
retrieveItems(String prefix,
Map<String,Object> propertieMap) |
static Map<String,Object> |
yaml2Properties(InputStream input)
|
static Map<String,Object> |
yaml2Properties(String input)
|
public static Map<String,Object> yaml2Properties(InputStream input)
InputStream to be a map Map, you have to close the inputStream by yourself, such as:try (InputStream in = url.openStream()) {
configMap.putAll(YAMLUtil.yaml2Properties(in));
}
input - the stream to be loadedpublic static Map<String,Object> yaml2Properties(String input)
input - the String to be loadedCopyright © 2017–2021 The Apache Software Foundation. All rights reserved.