
com.aventstack.chaintest.conf.YamlConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chaintest-core Show documentation
Show all versions of chaintest-core Show documentation
Core Java client library for ChainTest framework
The newest version!
package com.aventstack.chaintest.conf;
import com.aventstack.chaintest.util.RegexUtil;
import org.yaml.snakeyaml.Yaml;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
public class YamlConfig {
private static final String KEY_PATTERN = "\\$\\{([^}]+)}";
private Map _yaml;
private YamlConfig() { }
public static YamlConfig load(final InputStream is) {
final Yaml yaml = new Yaml();
final YamlConfig instance = new YamlConfig();
instance._yaml = yaml.load(is);
return instance;
}
public static YamlConfig load(final String path) throws FileNotFoundException {
return load(new FileInputStream(path));
}
public Optional getString(final String key) {
final Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy