public Comment deepCopy() { return new Comment(this); }
public Comment deepCopy() { return new Comment(this); }
/** * Performs a deep copy on <i>other</i>. */ public PluginOperationReturnDef(PluginOperationReturnDef other) { if (other.isSetType()) { this.type = other.type; } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
/** * Performs a deep copy on <i>other</i>. */ public PluginOperationReturnDef(PluginOperationReturnDef other) { if (other.isSetType()) { this.type = other.type; } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
/** * Performs a deep copy on <i>other</i>. */ public PluginOperationParamDef(PluginOperationParamDef other) { if (other.isSetName()) { this.name = other.name; } if (other.isSetType()) { this.type = other.type; } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
/** * Performs a deep copy on <i>other</i>. */ public PluginOperationParamDef(PluginOperationParamDef other) { if (other.isSetName()) { this.name = other.name; } if (other.isSetType()) { this.type = other.type; } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PluginOperationReturnDef struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = com.linecorp.centraldogma.internal.thrift.PluginOperationDataType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = new Comment(); struct.comment.read(iprot); struct.setCommentIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PluginOperationReturnDef struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = com.linecorp.centraldogma.internal.thrift.PluginOperationDataType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = new Comment(); struct.comment.read(iprot); struct.setCommentIsSet(true); } } }
@Override public CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) { final CompletableFuture<com.linecorp.centraldogma.internal.thrift.Commit> future = run(callback -> client.push(projectName, repositoryName, RevisionConverter.TO_DATA.convert(baseRevision), AuthorConverter.TO_DATA.convert(author), summary, new Comment(detail).setMarkup( MarkupConverter.TO_DATA.convert(markup)), convertToList(changes, ChangeConverter.TO_DATA::convert), callback)); return future.thenApply(PushResultConverter.TO_MODEL::convert); }
@Override public CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) { final CompletableFuture<com.linecorp.centraldogma.internal.thrift.Commit> future = run(callback -> client.push(projectName, repositoryName, RevisionConverter.TO_DATA.convert(baseRevision), AuthorConverter.TO_DATA.convert(author), summary, new Comment(detail).setMarkup( MarkupConverter.TO_DATA.convert(markup)), convertToList(changes, ChangeConverter.TO_DATA::convert), callback)); return future.thenApply(PushResultConverter.TO_MODEL::convert); }
@Override public CompletableFuture<PushResult> push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, String detail, Markup markup, Iterable<? extends Change<?>> changes) { final CompletableFuture<com.linecorp.centraldogma.internal.thrift.Commit> future = run(callback -> client.push(projectName, repositoryName, RevisionConverter.TO_DATA.convert(baseRevision), AuthorConverter.TO_DATA.convert(author), summary, new Comment(detail).setMarkup( MarkupConverter.TO_DATA.convert(markup)), convertToList(changes, ChangeConverter.TO_DATA::convert), callback)); return future.thenApply(PushResultConverter.TO_MODEL::convert); }
/** * Performs a deep copy on <i>other</i>. */ public NamedQuery(NamedQuery other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = other.name; } this.enabled = other.enabled; if (other.isSetRepositoryName()) { this.repositoryName = other.repositoryName; } if (other.isSetQuery()) { this.query = new Query(other.query); } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PluginOperationParamDef struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.name = iprot.readString(); struct.setNameIsSet(true); struct.type = com.linecorp.centraldogma.internal.thrift.PluginOperationDataType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = new Comment(); struct.comment.read(iprot); struct.setCommentIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, PluginOperationParamDef struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.name = iprot.readString(); struct.setNameIsSet(true); struct.type = com.linecorp.centraldogma.internal.thrift.PluginOperationDataType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = new Comment(); struct.comment.read(iprot); struct.setCommentIsSet(true); } } }
/** * Performs a deep copy on <i>other</i>. */ public NamedQuery(NamedQuery other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = other.name; } this.enabled = other.enabled; if (other.isSetRepositoryName()) { this.repositoryName = other.repositoryName; } if (other.isSetQuery()) { this.query = new Query(other.query); } if (other.isSetComment()) { this.comment = new Comment(other.comment); } }
@Override protected Commit doForward(com.linecorp.centraldogma.common.Commit commit) { final Comment comment = new Comment(); comment.setContent(commit.detail()); comment.setMarkup(MarkupConverter.TO_DATA.convert(commit.markup())); return new Commit(RevisionConverter.TO_DATA.convert(commit.revision()), AuthorConverter.TO_DATA.convert(commit.author()), commit.whenAsText(), commit.summary(), comment, Collections.emptyList()); }
@Test public void getHistory() throws Exception { doAnswer(invocation -> { final AsyncMethodCallback<List<TCommit>> callback = invocation.getArgument(5); callback.onComplete(ImmutableList.of(new TCommit( new TRevision(1), new TAuthor("name", "name@sample.com"), TIMESTAMP, "summary", new Comment("detail").setMarkup(TMarkup.PLAINTEXT), ImmutableList.of(new TChange("/a.txt", ChangeType.UPSERT_TEXT).setContent("content"))))); return null; }).when(iface).getHistory(any(), any(), any(), any(), any(), any()); assertThat(client.getHistory("project", "repo", new Revision(1), new Revision(3), "path").get()) .isEqualTo(ImmutableList.of(new Commit(new Revision(1), new Author("name", "name@sample.com"), Instant.parse(TIMESTAMP).toEpochMilli(), "summary", "detail", Markup.PLAINTEXT))); verify(iface).getHistory(eq("project"), eq("repo"), any(), any(), eq("path"), any()); }
@Override protected Commit doForward(com.linecorp.centraldogma.common.Commit commit) { final Comment comment = new Comment(); comment.setContent(commit.detail()); comment.setMarkup(MarkupConverter.TO_DATA.convert(commit.markup())); return new Commit(RevisionConverter.TO_DATA.convert(commit.revision()), AuthorConverter.TO_DATA.convert(commit.author()), commit.whenAsText(), commit.summary(), comment, Collections.emptyList()); }
@Test public void listRepositories() throws Exception { doAnswer(invocation -> { final AsyncMethodCallback<List<Repository>> callback = invocation.getArgument(1); final Repository repository = new Repository("repo").setHead( new TCommit(new TRevision(42), new TAuthor("hitchhiker", "arthur@dent.com"), "1978-03-08T00:00:00Z", "The primary phrase", new Comment(""), null)); callback.onComplete(ImmutableList.of(repository)); return null; }).when(iface).listRepositories(any(), any()); assertThat(client.listRepositories("project").get()).isEqualTo(ImmutableMap.of( "repo", new RepositoryInfo( "repo", new Commit(new Revision(42), new Author("hitchhiker", "arthur@dent.com"), Instant.parse("1978-03-08T00:00:00Z").toEpochMilli(), "The primary phrase", "", Markup.PLAINTEXT)))); verify(iface).listRepositories(eq("project"), any()); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, NamedQuery struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.name = iprot.readString(); struct.setNameIsSet(true); struct.enabled = iprot.readBool(); struct.setEnabledIsSet(true); struct.repositoryName = iprot.readString(); struct.setRepositoryNameIsSet(true); struct.query = new Query(); struct.query.read(iprot); struct.setQueryIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = new Comment(); struct.comment.read(iprot); struct.setCommentIsSet(true); } } }