- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.eclipse.che.plugin.yaml.shared.YamlPreference
类的一些代码示例,展示了YamlPreference
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlPreference
类的具体详情如下:
包路径:org.eclipse.che.plugin.yaml.shared.YamlPreference
类名称:YamlPreference
[英]Establishes the format for Yaml Preferences
[中]建立Yaml首选项的格式
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
/**
* Add a url to Yaml Preferences
*
* @param url The url you would like to add to yaml preferences
*/
private void addUrlToPreferences(String url) {
YamlPreference pref = new YamlPreference(url, "/*");
this.yamlPreferences.add(pref);
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
@Override
public String getValue(YamlPreference object) {
return object.getGlob();
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
@Override
public String getValue(YamlPreference object) {
return object.getUrl();
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-shared
/**
* Converts List of Yaml Preferences to Map of Globs to List of urls
*
* @param pref The list of Yaml Preferences you want to convert
* @return Map of Globs to List of urls of the Yaml Preferences
*/
public static Map<String, List<String>> yamlPreferenceToMap(List<YamlPreference> pref) {
Map<String, List<String>> preferenceMap = new HashMap<String, List<String>>();
for (YamlPreference prefItr : pref) {
if (preferenceMap.containsKey(prefItr.getGlob())) {
ArrayList<String> prefList = new ArrayList<String>(preferenceMap.get(prefItr.getGlob()));
prefList.add(prefItr.getUrl());
preferenceMap.put(prefItr.getGlob(), prefList);
} else {
ArrayList<String> prefList = new ArrayList<String>();
prefList.add(prefItr.getUrl());
preferenceMap.put(prefItr.getGlob(), prefList);
}
}
return preferenceMap;
}
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
@Override
public void update(int index, YamlPreference object, String value) {
object.setUrl(value);
delegate.nowDirty();
}
});
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
@Override
public void update(int index, YamlPreference object, String value) {
object.setGlob(value);
delegate.nowDirty();
}
});
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-server
/**
* Converts json string to yaml preference
*
* @param jsonStr The json string you would like to change into Yaml Preferences
* @return List of Yaml Preferences
*/
private List<YamlPreference> jsonToYamlPreference(String jsonStr) {
List<YamlPreference> preferences = new ArrayList<YamlPreference>();
Type type = new TypeToken<Map<String, String[]>>() {}.getType();
Map<String, String[]> yamlPreferenceMap = new Gson().fromJson(jsonStr, type);
if (yamlPreferenceMap == null || "".equals(jsonStr)) {
return new ArrayList<YamlPreference>();
}
for (Map.Entry<String, String[]> yamlPreferenceMapItem : yamlPreferenceMap.entrySet()) {
for (String url : yamlPreferenceMapItem.getValue()) {
YamlPreference newYamlPref = new YamlPreference(url, yamlPreferenceMapItem.getKey());
preferences.add(newYamlPref);
}
}
return preferences;
}
代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide
/**
* Converts json string to list of Yaml Preferences
*
* @param jsonStr The json string to turn into the list of Yaml Preferences
* @return List of Yaml Preferences
*/
private List<YamlPreference> jsonToYamlPreference(String jsonStr) {
ArrayList yamlPreferences = new ArrayList<YamlPreference>();
JsonObject parsedJson = Json.parse(jsonStr);
for (String glob : parsedJson.keys()) {
try {
JsonArray jsonArray = parsedJson.getArray(glob);
for (int arrNum = 0; arrNum < jsonArray.length(); arrNum++) {
YamlPreference newYamlPref = new YamlPreference(jsonArray.getString(arrNum), glob);
yamlPreferences.add(newYamlPref);
}
} catch (Exception e) {
LOG.debug(e.getMessage(), e);
}
}
return yamlPreferences;
}
本文整理了Java中org.eclipse.che.plugin.yaml.shared.YamlPreference.()方法的一些代码示例,展示了YamlPreference.()的具体用法。这些
我是一名优秀的程序员,十分优秀!