public DiffFileResult deepCopy() { return new DiffFileResult(this); }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case CONTENT: return getContent(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DiffFileResult) return this.equals((DiffFileResult)that); return false; }
/** * Performs a deep copy on <i>other</i>. */ public DiffFileResult(DiffFileResult other) { if (other.isSetType()) { this.type = other.type; } if (other.isSetContent()) { this.content = other.content; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((ChangeType)value); } break; case CONTENT: if (value == null) { unsetContent(); } else { setContent((String)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = com.linecorp.centraldogma.internal.thrift.ChangeType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.content = iprot.readString(); struct.setContentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DiffFileResult struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = com.linecorp.centraldogma.internal.thrift.ChangeType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); struct.content = iprot.readString(); struct.setContentIsSet(true); } }
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); } }
/** * Performs a deep copy on <i>other</i>. */ public DiffFileResult(DiffFileResult other) { if (other.isSetType()) { this.type = other.type; } if (other.isSetContent()) { this.content = other.content; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((ChangeType)value); } break; case CONTENT: if (value == null) { unsetContent(); } else { setContent((String)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = com.linecorp.centraldogma.internal.thrift.ChangeType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.content = iprot.readString(); struct.setContentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DiffFileResult struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = com.linecorp.centraldogma.internal.thrift.ChangeType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); struct.content = iprot.readString(); struct.setContentIsSet(true); } }
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); } }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case CONTENT: return getContent(); } throw new IllegalStateException(); }
public DiffFileResult deepCopy() { return new DiffFileResult(this); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case CONTENT: return isSetContent(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DiffFileResult) return this.equals((DiffFileResult)that); return false; }
switch (r.getType()) { case UPSERT_JSON: converted = unsafeCast(Change.ofJsonUpsert(query.path(), r.getContent())); break; case UPSERT_TEXT: converted = unsafeCast(Change.ofTextUpsert(query.path(), r.getContent())); break; case REMOVE: break; case RENAME: converted = unsafeCast(Change.ofRename(query.path(), r.getContent())); break; case APPLY_JSON_PATCH: converted = unsafeCast(Change.ofJsonPatch(query.path(), r.getContent())); break; case APPLY_TEXT_PATCH: converted = unsafeCast(Change.ofTextPatch(query.path(), r.getContent())); break; default: throw new Error("unknown change type: " + r.getType());
@Test public void diffFile() throws Exception { doAnswer(invocation -> { final AsyncMethodCallback<DiffFileResult> callback = invocation.getArgument(5); callback.onComplete(new DiffFileResult(ChangeType.UPSERT_TEXT, "some_text")); return null; }).when(iface).diffFile(any(), any(), any(), any(), any(), any()); assertThat(client.getDiff("project", "repo", new Revision(1), new Revision(3), Query.ofText("/a.txt")).get()) .isEqualTo(Change.ofTextUpsert("/a.txt", "some_text")); verify(iface).diffFile(eq("project"), eq("repo"), any(), any(), any(), any()); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case CONTENT: return isSetContent(); } throw new IllegalStateException(); }