public void write(org.apache.thrift.protocol.TProtocol oprot, FrontendRequest struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.type != null) { if (struct.isSetType()) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } } if (struct.startBuild != null) { if (struct.isSetStartBuild()) { oprot.writeFieldBegin(START_BUILD_FIELD_DESC); struct.startBuild.write(oprot); oprot.writeFieldEnd(); } } if (struct.buildStatus != null) { if (struct.isSetBuildStatus()) { oprot.writeFieldBegin(BUILD_STATUS_FIELD_DESC); struct.buildStatus.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public boolean equals(FrontendRequest that) { if (that == null) return false; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_startBuild = true && this.isSetStartBuild(); boolean that_present_startBuild = true && that.isSetStartBuild(); if (this_present_startBuild || that_present_startBuild) { if (!(this_present_startBuild && that_present_startBuild)) return false; if (!this.startBuild.equals(that.startBuild)) return false; } boolean this_present_buildStatus = true && this.isSetBuildStatus(); boolean that_present_buildStatus = true && that.isSetBuildStatus(); if (this_present_buildStatus || that_present_buildStatus) { if (!(this_present_buildStatus && that_present_buildStatus)) return false; if (!this.buildStatus.equals(that.buildStatus)) return false; } return true; }
/** Performs a deep copy on <i>other</i>. */ public FrontendRequest(FrontendRequest other) { if (other.isSetType()) { this.type = other.type; } if (other.isSetStartBuild()) { this.startBuild = new StartBuildRequest(other.startBuild); } if (other.isSetBuildStatus()) { this.buildStatus = new BuildStatusRequest(other.buildStatus); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, FrontendRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetType()) { optionals.set(0); } if (struct.isSetStartBuild()) { optionals.set(1); } if (struct.isSetBuildStatus()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetType()) { oprot.writeI32(struct.type.getValue()); } if (struct.isSetStartBuild()) { struct.startBuild.write(oprot); } if (struct.isSetBuildStatus()) { struct.buildStatus.write(oprot); } }
@Override public int compareTo(FrontendRequest other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetStartBuild()).compareTo(other.isSetStartBuild()); if (lastComparison != 0) { return lastComparison; } if (isSetStartBuild()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startBuild, other.startBuild); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetBuildStatus()).compareTo(other.isSetBuildStatus()); if (lastComparison != 0) { return lastComparison; } if (isSetBuildStatus()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildStatus, other.buildStatus); if (lastComparison != 0) { return lastComparison; } } return 0; }
public void read(org.apache.thrift.protocol.TProtocol iprot, FrontendRequest struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.type = com.facebook.buck.distributed.thrift.FrontendRequestType.findByValue( iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // START_BUILD if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.startBuild = new StartBuildRequest(); struct.startBuild.read(iprot); struct.setStartBuildIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BUILD_STATUS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.buildStatus = new BuildStatusRequest(); struct.buildStatus.read(iprot); struct.setBuildStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, FrontendRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.type = com.facebook.buck.distributed.thrift.FrontendRequestType.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } if (incoming.get(1)) { struct.startBuild = new StartBuildRequest(); struct.startBuild.read(iprot); struct.setStartBuildIsSet(true); } if (incoming.get(2)) { struct.buildStatus = new BuildStatusRequest(); struct.buildStatus.read(iprot); struct.setBuildStatusIsSet(true); } }