public Object getFieldValue(_Fields field) { switch (field) { case CONTENT: return getContent(); case MARKUP: return getMarkup(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case CONTENT: return getContent(); case MARKUP: return getMarkup(); } throw new IllegalStateException(); }
public CommentDto(Comment comment) { requireNonNull(comment, "comment"); content = comment.getContent(); markup = comment.getMarkup().name(); }
public CommentDto(Comment comment) { requireNonNull(comment, "comment"); content = comment.getContent(); markup = comment.getMarkup().name(); }
public CommentDto(Comment comment) { requireNonNull(comment, "comment"); content = comment.getContent(); markup = comment.getMarkup().name(); }
@Override public void push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Comment detail, List<Change> changes, AsyncMethodCallback resultHandler) { // TODO(trustin): Change Repository.commit() to return a Commit. handle(executor.execute(Command.push(convert(author), projectName, repositoryName, convert(baseRevision), summary, detail.getContent(), convert(detail.getMarkup()), convert(changes, Converter::convert))) .thenCompose(newRev -> projectManager.get(projectName).repos().get(repositoryName) .history(newRev, newRev, "/**")) .thenApply(commits -> convert(commits.get(0))), resultHandler); }
@Override public void push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Comment detail, List<Change> changes, AsyncMethodCallback resultHandler) { // TODO(trustin): Change Repository.commit() to return a Commit. handle(executor.execute(Command.push(convert(author), projectName, repositoryName, convert(baseRevision), summary, detail.getContent(), convert(detail.getMarkup()), convert(changes, Converter::convert))) .thenCompose(newRev -> projectManager.get(projectName).repos().get(repositoryName) .history(newRev, newRev, "/**")) .thenApply(commits -> convert(commits.get(0))), resultHandler); }
@Override public void push(String projectName, String repositoryName, Revision baseRevision, Author author, String summary, Comment detail, List<Change> changes, AsyncMethodCallback resultHandler) { // TODO(trustin): Change Repository.commit() to return a Commit. handle(executor.execute(Command.push(convert(author), projectName, repositoryName, convert(baseRevision), summary, detail.getContent(), convert(detail.getMarkup()), convert(changes, Converter::convert))) .thenCompose(newRev -> projectManager.get(projectName).repos().get(repositoryName) .history(newRev, newRev, "/**")) .thenApply(commits -> convert(commits.get(0))), resultHandler); }
@Override protected com.linecorp.centraldogma.common.Commit doBackward(Commit commit) { final Markup markup = Markup.valueOf(commit.getDetail().getMarkup().name()); return new com.linecorp.centraldogma.common.Commit( RevisionConverter.TO_MODEL.convert(commit.getRevision()), AuthorConverter.TO_MODEL.convert(commit.getAuthor()), Instant.parse(commit.getTimestamp()).toEpochMilli(), commit.getSummary(), commit.getDetail().getContent(), markup); } }
@Override protected com.linecorp.centraldogma.common.Commit doBackward(Commit commit) { final Markup markup = Markup.valueOf(commit.getDetail().getMarkup().name()); return new com.linecorp.centraldogma.common.Commit( RevisionConverter.TO_MODEL.convert(commit.getRevision()), AuthorConverter.TO_MODEL.convert(commit.getAuthor()), Instant.parse(commit.getTimestamp()).toEpochMilli(), commit.getSummary(), commit.getDetail().getContent(), markup); } }