gpt4 book ai didi

org.eclipse.che.plugin.yaml.shared.YamlDTO类的使用及代码示例

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

本文整理了Java中org.eclipse.che.plugin.yaml.shared.YamlDTO类的一些代码示例,展示了YamlDTO类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlDTO类的具体详情如下:
包路径:org.eclipse.che.plugin.yaml.shared.YamlDTO
类名称:YamlDTO

YamlDTO介绍

[英]Interface of DTO for sending schemas
[中]DTO发送模式的接口

代码示例

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-shared

public YamlDTOImpl(org.eclipse.che.plugin.yaml.shared.YamlDTO origin) {
 java.util.Map<java.lang.String, java.lang.String> schemasIn = origin.getSchemas();
 if (schemasIn != null) {
  java.util.Map<java.lang.String, java.lang.String> schemasOut = new java.util.HashMap<java.lang.String, java.lang.String>();
  for (java.util.Map.Entry<String, java.lang.String> entry0 : schemasIn.entrySet()) {
   java.lang.String schemasIn_ = entry0.getValue();
    schemasOut.put(entry0.getKey(), schemasIn_);
  }
  this.schemas = schemasOut;
 }
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-ide

/**
 * Service for sending the schemas to the yaml language server
 *
 * @param schemas The schemas you want to send to the yaml language server
 * @return Promise<Void> of the request
 */
@Override
public Promise<Void> putSchemas(Map<String, String> schemas) {
 YamlDTO schemaAddition = dtoFactory.createDto(YamlDTO.class).withSchemas(schemas);
 String schemasLocation = getWsAgentBaseUrl() + "/yaml/schemas";
 return asyncRequestFactory
   .createPostRequest(schemasLocation, schemaAddition)
   .loader(loader)
   .send();
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-shared

public YamlDTOImpl(org.eclipse.che.plugin.yaml.shared.YamlDTO origin) {
 java.util.Map<java.lang.String, java.lang.String> schemasIn = origin.getSchemas();
 if (schemasIn != null) {
  java.util.Map<java.lang.String, java.lang.String> schemasOut = new java.util.HashMap<java.lang.String, java.lang.String>();
  for (java.util.Map.Entry<String, java.lang.String> entry0 : schemasIn.entrySet()) {
   java.lang.String schemasIn_ = entry0.getValue();
    schemasOut.put(entry0.getKey(), schemasIn_);
  }
  this.schemas = schemasOut;
 }
}

代码示例来源:origin: org.eclipse.che.plugin/che-plugin-yaml-server

/**
  * Route for getting getting schemas from client side and injecting them into yaml language server
  *
  * @param yamlDto A yamlDTO containing the list of schemas you would like to add
  */
 @POST
 @Path("schemas")
 @Consumes(MediaType.APPLICATION_JSON)
 public void putSchemas(YamlDTO yamlDto) throws ApiException {

  LanguageServer yamlLS = YamlLanguageServerConfig.getYamlLanguageServer();

  if (yamlDto != null && yamlLS != null) {

   Endpoint endpoint = ServiceEndpoints.toEndpoint(yamlLS);
   YamlSchemaAssociations serviceObject =
     ServiceEndpoints.toServiceObject(endpoint, YamlSchemaAssociations.class);

   Map<String, String[]> schemaAssociations = new HashMap<>();
   Map<String, String> yamlDtoSchemas = yamlDto.getSchemas();

   for (Map.Entry<String, String> schema : yamlDtoSchemas.entrySet()) {
    schemaAssociations.put(
      schema.getKey(), new Gson().fromJson(schema.getValue(), String[].class));
   }

   serviceObject.yamlSchemaAssociation(schemaAssociations);
  }
 }
}

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