Пример #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, OnlineStatus struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(5);
   if (incoming.get(0)) {
     struct.name = iprot.readString();
     struct.setNameIsSet(true);
   }
   if (incoming.get(1)) {
     struct.plugin = iprot.readString();
     struct.setPluginIsSet(true);
   }
   if (incoming.get(2)) {
     struct.packagename = iprot.readString();
     struct.setPackagenameIsSet(true);
   }
   if (incoming.get(3)) {
     struct.status = DownloadStatus.findByValue(iprot.readI32());
     struct.setStatusIsSet(true);
   }
   if (incoming.get(4)) {
     struct.size = iprot.readI64();
     struct.setSizeIsSet(true);
   }
 }
Пример #2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, OnlineStatus struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.plugin != null) {
        oprot.writeFieldBegin(PLUGIN_FIELD_DESC);
        oprot.writeString(struct.plugin);
        oprot.writeFieldEnd();
      }
      if (struct.packagename != null) {
        oprot.writeFieldBegin(PACKAGENAME_FIELD_DESC);
        oprot.writeString(struct.packagename);
        oprot.writeFieldEnd();
      }
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(struct.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SIZE_FIELD_DESC);
      oprot.writeI64(struct.size);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Пример #3
0
 /** Performs a deep copy on <i>other</i>. */
 public OnlineStatus(OnlineStatus other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetName()) {
     this.name = other.name;
   }
   if (other.isSetPlugin()) {
     this.plugin = other.plugin;
   }
   if (other.isSetPackagename()) {
     this.packagename = other.packagename;
   }
   if (other.isSetStatus()) {
     this.status = other.status;
   }
   this.size = other.size;
 }
Пример #4
0
  public boolean equals(OnlineStatus that) {
    if (that == null) return false;

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name)) return false;
      if (!this.name.equals(that.name)) return false;
    }

    boolean this_present_plugin = true && this.isSetPlugin();
    boolean that_present_plugin = true && that.isSetPlugin();
    if (this_present_plugin || that_present_plugin) {
      if (!(this_present_plugin && that_present_plugin)) return false;
      if (!this.plugin.equals(that.plugin)) return false;
    }

    boolean this_present_packagename = true && this.isSetPackagename();
    boolean that_present_packagename = true && that.isSetPackagename();
    if (this_present_packagename || that_present_packagename) {
      if (!(this_present_packagename && that_present_packagename)) return false;
      if (!this.packagename.equals(that.packagename)) return false;
    }

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status)) return false;
      if (!this.status.equals(that.status)) return false;
    }

    boolean this_present_size = true;
    boolean that_present_size = true;
    if (this_present_size || that_present_size) {
      if (!(this_present_size && that_present_size)) return false;
      if (this.size != that.size) return false;
    }

    return true;
  }
Пример #5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, OnlineStatus struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetName()) {
     optionals.set(0);
   }
   if (struct.isSetPlugin()) {
     optionals.set(1);
   }
   if (struct.isSetPackagename()) {
     optionals.set(2);
   }
   if (struct.isSetStatus()) {
     optionals.set(3);
   }
   if (struct.isSetSize()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetPlugin()) {
     oprot.writeString(struct.plugin);
   }
   if (struct.isSetPackagename()) {
     oprot.writeString(struct.packagename);
   }
   if (struct.isSetStatus()) {
     oprot.writeI32(struct.status.getValue());
   }
   if (struct.isSetSize()) {
     oprot.writeI64(struct.size);
   }
 }
Пример #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, OnlineStatus 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: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PLUGIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.plugin = iprot.readString();
              struct.setPluginIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PACKAGENAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.packagename = iprot.readString();
              struct.setPackagenameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.status = DownloadStatus.findByValue(iprot.readI32());
              struct.setStatusIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.size = iprot.readI64();
              struct.setSizeIsSet(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();
    }
Пример #7
0
  public int compareTo(OnlineStatus other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    OnlineStatus typedOther = (OnlineStatus) other;

    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPlugin()).compareTo(typedOther.isSetPlugin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPlugin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.plugin, typedOther.plugin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPackagename()).compareTo(typedOther.isSetPackagename());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPackagename()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.packagename, typedOther.packagename);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSize()).compareTo(typedOther.isSetSize());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSize()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, typedOther.size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }