本文整理了Java中com.linecorp.centraldogma.internal.thrift.WatchRepositoryResult.<init>()
方法的一些代码示例,展示了WatchRepositoryResult.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WatchRepositoryResult.<init>()
方法的具体详情如下:
包路径:com.linecorp.centraldogma.internal.thrift.WatchRepositoryResult
类名称:WatchRepositoryResult
方法名:<init>
[英]Performs a deep copy on other.
[中]在其他计算机上执行深度复制。
代码示例来源:origin: line/centraldogma
public WatchRepositoryResult deepCopy() {
return new WatchRepositoryResult(this);
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-common-legacy-shaded
public WatchRepositoryResult deepCopy() {
return new WatchRepositoryResult(this);
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server
private static void handleWatchRepositoryResult(
CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
AsyncMethodCallback resultHandler) {
future.handle((res, cause) -> {
if (cause == null) {
final WatchRepositoryResult wrr = new WatchRepositoryResult();
wrr.setRevision(convert(res));
resultHandler.onComplete(wrr);
} else if (cause instanceof CancellationException) {
resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
} else {
logAndInvokeOnError("watchRepository", resultHandler, cause);
}
return null;
});
}
代码示例来源:origin: line/centraldogma
private static void handleWatchRepositoryResult(
CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
AsyncMethodCallback resultHandler) {
future.handle((res, cause) -> {
if (cause == null) {
final WatchRepositoryResult wrr = new WatchRepositoryResult();
wrr.setRevision(convert(res));
resultHandler.onComplete(wrr);
} else if (cause instanceof CancellationException) {
resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
} else {
logAndInvokeOnError("watchRepository", resultHandler, cause);
}
return null;
});
}
代码示例来源:origin: line/centraldogma
@Test
public void watchRepositoryTimedOut() throws Exception {
doAnswer(invocation -> {
AsyncMethodCallback<WatchRepositoryResult> callback = invocation.getArgument(5);
callback.onComplete(new WatchRepositoryResult());
return null;
}).when(iface).watchRepository(any(), any(), any(), anyString(), anyLong(), any());
assertThat(client.watchRepository("project", "repo", new Revision(1), "/a.txt", 100).get())
.isNull();
verify(iface).watchRepository(eq("project"), eq("repo"), any(), eq("/a.txt"), eq(100L), any());
}
代码示例来源:origin: line/centraldogma
@Test
public void watchRepository() throws Exception {
doAnswer(invocation -> {
final AsyncMethodCallback<WatchRepositoryResult> callback = invocation.getArgument(5);
callback.onComplete(new WatchRepositoryResult().setRevision(new TRevision(42)));
return null;
}).when(iface).watchRepository(any(), any(), any(), anyString(), anyLong(), any());
assertThat(client.watchRepository("project", "repo", new Revision(1), "/a.txt", 100).get())
.isEqualTo(new Revision(42));
verify(iface).watchRepository(eq("project"), eq("repo"), any(), eq("/a.txt"), eq(100L), any());
}
代码示例来源:origin: com.linecorp.centraldogma/centraldogma-server-shaded
private static void handleWatchRepositoryResult(
CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
AsyncMethodCallback resultHandler) {
future.handle(voidFunction((res, cause) -> {
if (cause == null) {
final WatchRepositoryResult wrr = new WatchRepositoryResult();
wrr.setRevision(convert(res));
resultHandler.onComplete(wrr);
} else if (cause instanceof CancellationException) {
resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
} else {
logAndInvokeOnError("watchRepository", resultHandler, cause);
}
}));
}
内容来源于网络,如有侵权,请联系作者删除!