public Comment deepCopy() { return new Comment(this); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case CONTENT: if (value == null) { unsetContent(); } else { setContent((String)value); } break; case MARKUP: if (value == null) { unsetMarkup(); } else { setMarkup((Markup)value); } break; } }
public Object getFieldValue(_Fields field) { switch (field) { case CONTENT: return getContent(); case MARKUP: return getMarkup(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public Comment(Comment other) { if (other.isSetContent()) { this.content = other.content; } if (other.isSetMarkup()) { this.markup = other.markup; } }
@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 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()); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Comment) return this.equals((Comment)that); return false; }
public void write(org.apache.thrift.protocol.TProtocol oprot, Comment struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.content != null) { oprot.writeFieldBegin(CONTENT_FIELD_DESC); oprot.writeString(struct.content); oprot.writeFieldEnd(); } if (struct.markup != null) { if (struct.isSetMarkup()) { oprot.writeFieldBegin(MARKUP_FIELD_DESC); oprot.writeI32(struct.markup.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("Comment("); boolean first = true; sb.append("content:"); if (this.content == null) { sb.append("null"); } else { sb.append(this.content); } first = false; if (isSetMarkup()) { if (!first) sb.append(", "); sb.append("markup:"); if (this.markup == null) { sb.append("null"); } else { sb.append(this.markup); } first = false; } sb.append(")"); return sb.toString(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
@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 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()); }
/** * Performs a deep copy on <i>other</i>. */ public Comment(Comment other) { if (other.isSetContent()) { this.content = other.content; } if (other.isSetMarkup()) { this.markup = other.markup; } }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Comment) return this.equals((Comment)that); return false; }
public void write(org.apache.thrift.protocol.TProtocol oprot, Comment struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.content != null) { oprot.writeFieldBegin(CONTENT_FIELD_DESC); oprot.writeString(struct.content); oprot.writeFieldEnd(); } if (struct.markup != null) { if (struct.isSetMarkup()) { oprot.writeFieldBegin(MARKUP_FIELD_DESC); oprot.writeI32(struct.markup.getValue()); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("Comment("); boolean first = true; sb.append("content:"); if (this.content == null) { sb.append("null"); } else { sb.append(this.content); } first = false; if (isSetMarkup()) { if (!first) sb.append(", "); sb.append("markup:"); if (this.markup == null) { sb.append("null"); } else { sb.append(this.markup); } first = false; } sb.append(")"); return sb.toString(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }