com.linecorp.centraldogma.internal.Jackson.valueToTree()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(112)

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

Jackson.valueToTree介绍

暂无

代码示例

代码示例来源:origin: line/centraldogma

/**
 * Converts this patch into JSON.
 */
public ArrayNode toJson() {
  return (ArrayNode) Jackson.valueToTree(this);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common

/**
 * Converts this patch into JSON.
 */
public ArrayNode toJson() {
  return (ArrayNode) Jackson.valueToTree(this);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-shaded

/**
 * Converts this patch into JSON.
 */
public ArrayNode toJson() {
  return (ArrayNode) Jackson.valueToTree(this);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-shaded

/**
 * Converts {@link JsonPatchOperation}s to an array of {@link JsonNode}.
 */
public static JsonNode asJsonArray(JsonPatchOperation... jsonPatchOperations) {
  requireNonNull(jsonPatchOperations, "jsonPatchOperations");
  return Jackson.valueToTree(jsonPatchOperations);
}

代码示例来源:origin: line/centraldogma

/**
 * Converts {@link JsonPatchOperation}s to an array of {@link JsonNode}.
 */
public static JsonNode asJsonArray(JsonPatchOperation... jsonPatchOperations) {
  requireNonNull(jsonPatchOperations, "jsonPatchOperations");
  return Jackson.valueToTree(jsonPatchOperations);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common

/**
 * Converts {@link JsonPatchOperation}s to an array of {@link JsonNode}.
 */
public static JsonNode asJsonArray(JsonPatchOperation... jsonPatchOperations) {
  requireNonNull(jsonPatchOperations, "jsonPatchOperations");
  return Jackson.valueToTree(jsonPatchOperations);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common

/**
 * Converts this {@link JsonPatchOperation} to a {@link JsonNode}.
 */
public JsonNode toJsonNode() {
  return JsonNodeFactory.instance.arrayNode().add(Jackson.valueToTree(this));
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-shaded

/**
 * Converts this {@link JsonPatchOperation} to a {@link JsonNode}.
 */
public JsonNode toJsonNode() {
  return JsonNodeFactory.instance.arrayNode().add(Jackson.valueToTree(this));
}

代码示例来源:origin: line/centraldogma

/**
 * Converts this {@link JsonPatchOperation} to a {@link JsonNode}.
 */
public JsonNode toJsonNode() {
  return JsonNodeFactory.instance.arrayNode().add(Jackson.valueToTree(this));
}

代码示例来源:origin: line/centraldogma

/**
 * Removes a {@link ProjectMetadata} whose name equals to the specified {@code projectName}.
 */
public CompletableFuture<Revision> removeProject(Author author, String projectName) {
  requireNonNull(author, "author");
  requireNonNull(projectName, "projectName");
  final Change<JsonNode> change = Change.ofJsonPatch(
      METADATA_JSON,
      asJsonArray(new TestAbsenceOperation(PROJECT_REMOVAL),
            new AddOperation(PROJECT_REMOVAL,
                     Jackson.valueToTree(UserAndTimestamp.of(author)))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author,
               "Remove the project: " + projectName, change);
}

代码示例来源:origin: line/centraldogma

/**
 * Replaces {@link Permission}s of the specified {@code path} with the specified {@code permission}.
 */
private CompletableFuture<Revision> replacePermissionAtPointer(Author author,
                                String projectName, JsonPointer path,
                                Collection<Permission> permission,
                                String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                new ReplaceOperation(path, Jackson.valueToTree(permission)).toJsonNode());
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

/**
 * Replaces {@link Permission}s of the specified {@code path} with the specified {@code permission}.
 */
private CompletableFuture<Revision> replacePermissionAtPointer(Author author,
                                String projectName, JsonPointer path,
                                Collection<Permission> permission,
                                String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                new ReplaceOperation(path, Jackson.valueToTree(permission)).toJsonNode());
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

/**
 * Replaces {@link Permission}s of the specified {@code path} with the specified {@code permission}.
 */
private CompletableFuture<Revision> replacePermissionAtPointer(Author author,
                                String projectName, JsonPointer path,
                                Collection<Permission> permission,
                                String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                new ReplaceOperation(path, Jackson.valueToTree(permission)).toJsonNode());
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

/**
 * Removes a {@link ProjectMetadata} whose name equals to the specified {@code projectName}.
 */
public CompletableFuture<Revision> removeProject(Author author, String projectName) {
  requireNonNull(author, "author");
  requireNonNull(projectName, "projectName");
  final Change<JsonNode> change = Change.ofJsonPatch(
      METADATA_JSON,
      asJsonArray(new TestAbsenceOperation(PROJECT_REMOVAL),
            new AddOperation(PROJECT_REMOVAL,
                     Jackson.valueToTree(UserAndTimestamp.of(author)))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author,
               "Remove the project: " + projectName, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

/**
 * Removes a {@link ProjectMetadata} whose name equals to the specified {@code projectName}.
 */
public CompletableFuture<Revision> removeProject(Author author, String projectName) {
  requireNonNull(author, "author");
  requireNonNull(projectName, "projectName");
  final Change<JsonNode> change = Change.ofJsonPatch(
      METADATA_JSON,
      asJsonArray(new TestAbsenceOperation(PROJECT_REMOVAL),
            new AddOperation(PROJECT_REMOVAL,
                     Jackson.valueToTree(UserAndTimestamp.of(author)))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author,
               "Remove the project: " + projectName, change);
}

代码示例来源:origin: line/centraldogma

/**
 * Removes a {@link RepositoryMetadata} of the specified {@code repoName} from the specified
 * {@code projectName}.
 */
public CompletableFuture<Revision> removeRepo(Author author, String projectName, String repoName) {
  requireNonNull(author, "author");
  requireNonNull(projectName, "projectName");
  requireNonNull(repoName, "repoName");
  final JsonPointer path = JsonPointer.compile("/repos" + encodeSegment(repoName) + "/removal");
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                asJsonArray(new TestAbsenceOperation(path),
                      new AddOperation(path, Jackson.valueToTree(
                          UserAndTimestamp.of(author)))));
  final String commitSummary = "Remove the repo '" + repoName + "' from the project " + projectName;
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

/**
 * Removes a {@link RepositoryMetadata} of the specified {@code repoName} from the specified
 * {@code projectName}.
 */
public CompletableFuture<Revision> removeRepo(Author author, String projectName, String repoName) {
  requireNonNull(author, "author");
  requireNonNull(projectName, "projectName");
  requireNonNull(repoName, "repoName");
  final JsonPointer path = JsonPointer.compile("/repos" + encodeSegment(repoName) + "/removal");
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                asJsonArray(new TestAbsenceOperation(path),
                      new AddOperation(path, Jackson.valueToTree(
                          UserAndTimestamp.of(author)))));
  final String commitSummary = "Remove the repo '" + repoName + "' from the project " + projectName;
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: line/centraldogma

/**
 * Adds {@link Permission}s to the specified {@code path}.
 */
private CompletableFuture<Revision> addPermissionAtPointer(Author author,
                              String projectName, JsonPointer path,
                              Collection<Permission> permission,
                              String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                asJsonArray(new TestAbsenceOperation(path),
                      new AddOperation(path, Jackson.valueToTree(permission))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server

/**
 * Adds {@link Permission}s to the specified {@code path}.
 */
private CompletableFuture<Revision> addPermissionAtPointer(Author author,
                              String projectName, JsonPointer path,
                              Collection<Permission> permission,
                              String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                asJsonArray(new TestAbsenceOperation(path),
                      new AddOperation(path, Jackson.valueToTree(permission))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded

/**
 * Adds {@link Permission}s to the specified {@code path}.
 */
private CompletableFuture<Revision> addPermissionAtPointer(Author author,
                              String projectName, JsonPointer path,
                              Collection<Permission> permission,
                              String commitSummary) {
  final Change<JsonNode> change =
      Change.ofJsonPatch(METADATA_JSON,
                asJsonArray(new TestAbsenceOperation(path),
                      new AddOperation(path, Jackson.valueToTree(permission))));
  return metadataRepo.push(projectName, Project.REPO_DOGMA, author, commitSummary, change);
}

相关文章