gpt4 book ai didi

uk.gov.dstl.baleen.core.utils.yaml.YamlString.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 22:49:31 27 4
gpt4 key购买 nike

本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlString.<init>()方法的一些代码示例,展示了YamlString.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlString.<init>()方法的具体详情如下:
包路径:uk.gov.dstl.baleen.core.utils.yaml.YamlString
类名称:YamlString
方法名:<init>

YamlString.<init>介绍

[英]Construct yaml from string.
[中]从字符串构造yaml。

代码示例

代码示例来源:origin: uk.gov.dstl.baleen/baleen-core

/**
 * Construct configuration from raw yaml string.
 *
 * @param yaml string
 * @throws Exception
 */
public YamlConfiguration(String yaml) throws IOException {
 this(new YamlString(yaml));
}

代码示例来源:origin: dstl/baleen

/**
 * New instance.
 *
 * @throws Exception
 */
public YamlConfiguration() throws IOException {
 this(new YamlString(""));
}

代码示例来源:origin: uk.gov.dstl.baleen/baleen-core

/**
 * New instance.
 *
 * @throws Exception
 */
public YamlConfiguration() throws IOException {
 this(new YamlString(""));
}

代码示例来源:origin: dstl/baleen

/**
 * Construct configuration from raw yaml string.
 *
 * @param yaml string
 * @throws Exception
 */
public YamlConfiguration(String yaml) throws IOException {
 this(new YamlString(yaml));
}

代码示例来源:origin: dstl/baleen

/**
 * Construct configuration from raw yaml string.
 *
 * @param clazz
 * @param resourcePath
 * @throws Exception
 */
public YamlConfiguration(InputStream inputStream) throws IOException {
 this(new YamlString(IOUtils.toString(inputStream, Charset.defaultCharset())));
}

代码示例来源:origin: uk.gov.dstl.baleen/baleen-core

/**
 * Construct configuration from raw yaml string.
 *
 * @param clazz
 * @param resourcePath
 * @throws Exception
 */
public YamlConfiguration(InputStream inputStream) throws IOException {
 this(new YamlString(IOUtils.toString(inputStream, Charset.defaultCharset())));
}

代码示例来源:origin: dstl/baleen

return new YamlString("");
} else if (yamls.size() == 1) {
 return yamls.get(0);

代码示例来源:origin: uk.gov.dstl.baleen/baleen-core

String source = null;
if (!Strings.isNullOrEmpty(config)) {
 yaml = new YamlString(config);
 source = "string";
} else if (!Strings.isNullOrEmpty(file)) {

代码示例来源:origin: dstl/baleen

String source = null;
if (!Strings.isNullOrEmpty(config)) {
 yaml = new YamlString(config);
 source = "string";
} else if (!Strings.isNullOrEmpty(file)) {

代码示例来源:origin: dstl/baleen

@Test
public void testNoMergeRequired() throws IOException {
 String yaml1 = "test1: value1";
 String yaml2 = "test2: value2";
 MergedYaml mergedYaml =
   new MergedYaml(ImmutableList.of(new YamlString(yaml1), new YamlString(yaml2)));
 Object dataTree = mergedYaml.dataTree();
 assertTrue(dataTree instanceof Map);
 Map<String, Object> map = (Map) dataTree;
 assertTrue(map.containsKey("test1"));
 assertTrue(map.containsKey("test2"));
 assertEquals("value1", map.get("test1"));
 assertEquals("value2", map.get("test2"));
}

代码示例来源:origin: dstl/baleen

@Test
public void testSimpleMergeRequired() throws IOException {
 String yaml1 = "test: value1";
 String yaml2 = "test: \n- value2\n- value3";
 MergedYaml mergedYaml =
   new MergedYaml(ImmutableList.of(new YamlString(yaml1), new YamlString(yaml2)));
 Object dataTree = mergedYaml.dataTree();
 assertTrue(dataTree instanceof Map);
 Map<String, Object> map = (Map) dataTree;
 assertTrue(map.containsKey("test"));
 ;
 assertTrue(map.get("test") instanceof List);
 List<Object> value = (List<Object>) map.get("test");
 assertTrue(value.contains("value1"));
 assertTrue(value.contains("value2"));
 assertTrue(value.contains("value3"));
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com