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

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

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

Jackson.writeValueAsPrettyString介绍

暂无

代码示例

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    // Should never reach here.
    throw new Error(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
  public String toString() {
    try {
      return Jackson.writeValueAsPrettyString(this);
    } catch (JsonProcessingException e) {
      // Should never reach here.
      throw new Error(e);
    }
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
  public String toString() {
    try {
      return Jackson.writeValueAsPrettyString(this);
    } catch (JsonProcessingException e) {
      // Should never reach here.
      throw new Error(e);
    }
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    // Should never reach here.
    throw new Error(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    throw new IllegalStateException(e);
  }
}

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

@Override
public String toString() {
  try {
    return Jackson.writeValueAsPrettyString(this);
  } catch (JsonProcessingException e) {
    // Should never reach here.
    throw new Error(e);
  }
}

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

@Override
  public String toString() {
    try {
      return Jackson.writeValueAsPrettyString(this);
    } catch (JsonProcessingException e) {
      // Should never reach here.
      throw new Error(e);
    }
  }
}

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

/**
 * Returns the prettified textual representation of {@link #content()}. Only a {@link TreeNode} is
 * prettified currently.
 *
 * @throws IllegalStateException if this {@link Entry} is a directory
 */
public String contentAsPrettyText() {
  ensureContent();
  if (contentAsPrettyText == null) {
    if (content instanceof TreeNode) {
      try {
        contentAsPrettyText = Jackson.writeValueAsPrettyString(content);
      } catch (JsonProcessingException e) {
        // Should never happen because it's a JSON tree already.
        throw new Error(e);
      }
    } else {
      contentAsPrettyText = content.toString();
    }
  }
  return contentAsPrettyText;
}

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

/**
 * Returns the prettified textual representation of the specified content. Only a {@link TreeNode} is
 * prettified currently.
 *
 * @throws IllegalStateException if the content is {@code null}
 */
default String contentAsPrettyText() {
  final T content = content();
  if (content instanceof TreeNode) {
    try {
      return Jackson.writeValueAsPrettyString(content);
    } catch (JsonProcessingException e) {
      // Should never happen because it's a JSON tree already.
      throw new Error(e);
    }
  } else {
    return content.toString();
  }
}

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

/**
 * Returns the prettified textual representation of the specified content. Only a {@link TreeNode} is
 * prettified currently.
 *
 * @throws IllegalStateException if the content is {@code null}
 */
default String contentAsPrettyText() {
  final T content = content();
  if (content instanceof TreeNode) {
    try {
      return Jackson.writeValueAsPrettyString(content);
    } catch (JsonProcessingException e) {
      // Should never happen because it's a JSON tree already.
      throw new Error(e);
    }
  } else {
    return content.toString();
  }
}

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

@Override
  protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req)
      throws Exception {
    return HttpResponse.of(HttpStatus.OK,
                MediaType.JSON_UTF_8,
                Jackson.writeValueAsPrettyString(pm.cacheStats()));
  }
});

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

@Override
  protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req)
      throws Exception {
    return HttpResponse.of(HttpStatus.OK,
                MediaType.JSON_UTF_8,
                Jackson.writeValueAsPrettyString(pm.cacheStats()));
  }
});

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

@Override
  protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req)
      throws Exception {
    return HttpResponse.of(HttpStatus.OK,
                MediaType.JSON_UTF_8,
                Jackson.writeValueAsPrettyString(pm.cacheStats()));
  }
});

相关文章