com.linecorp.centraldogma.internal.thrift.WatchRepositoryResult.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(100)

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

WatchRepositoryResult.<init>介绍

[英]Performs a deep copy on other.
[中]在其他计算机上执行深度复制。

代码示例

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

  1. public WatchRepositoryResult deepCopy() {
  2. return new WatchRepositoryResult(this);
  3. }

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

  1. public WatchRepositoryResult deepCopy() {
  2. return new WatchRepositoryResult(this);
  3. }

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

  1. private static void handleWatchRepositoryResult(
  2. CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
  3. AsyncMethodCallback resultHandler) {
  4. future.handle((res, cause) -> {
  5. if (cause == null) {
  6. final WatchRepositoryResult wrr = new WatchRepositoryResult();
  7. wrr.setRevision(convert(res));
  8. resultHandler.onComplete(wrr);
  9. } else if (cause instanceof CancellationException) {
  10. resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
  11. } else {
  12. logAndInvokeOnError("watchRepository", resultHandler, cause);
  13. }
  14. return null;
  15. });
  16. }

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

  1. private static void handleWatchRepositoryResult(
  2. CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
  3. AsyncMethodCallback resultHandler) {
  4. future.handle((res, cause) -> {
  5. if (cause == null) {
  6. final WatchRepositoryResult wrr = new WatchRepositoryResult();
  7. wrr.setRevision(convert(res));
  8. resultHandler.onComplete(wrr);
  9. } else if (cause instanceof CancellationException) {
  10. resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
  11. } else {
  12. logAndInvokeOnError("watchRepository", resultHandler, cause);
  13. }
  14. return null;
  15. });
  16. }

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

  1. @Test
  2. public void watchRepositoryTimedOut() throws Exception {
  3. doAnswer(invocation -> {
  4. AsyncMethodCallback<WatchRepositoryResult> callback = invocation.getArgument(5);
  5. callback.onComplete(new WatchRepositoryResult());
  6. return null;
  7. }).when(iface).watchRepository(any(), any(), any(), anyString(), anyLong(), any());
  8. assertThat(client.watchRepository("project", "repo", new Revision(1), "/a.txt", 100).get())
  9. .isNull();
  10. verify(iface).watchRepository(eq("project"), eq("repo"), any(), eq("/a.txt"), eq(100L), any());
  11. }

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

  1. @Test
  2. public void watchRepository() throws Exception {
  3. doAnswer(invocation -> {
  4. final AsyncMethodCallback<WatchRepositoryResult> callback = invocation.getArgument(5);
  5. callback.onComplete(new WatchRepositoryResult().setRevision(new TRevision(42)));
  6. return null;
  7. }).when(iface).watchRepository(any(), any(), any(), anyString(), anyLong(), any());
  8. assertThat(client.watchRepository("project", "repo", new Revision(1), "/a.txt", 100).get())
  9. .isEqualTo(new Revision(42));
  10. verify(iface).watchRepository(eq("project"), eq("repo"), any(), eq("/a.txt"), eq(100L), any());
  11. }

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

  1. private static void handleWatchRepositoryResult(
  2. CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
  3. AsyncMethodCallback resultHandler) {
  4. future.handle(voidFunction((res, cause) -> {
  5. if (cause == null) {
  6. final WatchRepositoryResult wrr = new WatchRepositoryResult();
  7. wrr.setRevision(convert(res));
  8. resultHandler.onComplete(wrr);
  9. } else if (cause instanceof CancellationException) {
  10. resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
  11. } else {
  12. logAndInvokeOnError("watchRepository", resultHandler, cause);
  13. }
  14. }));
  15. }

相关文章