예제 #1
0
파일: Advert.java 프로젝트: kbence/booktion
 @Override
 public void clear() {
   setIdIsSet(false);
   this.id = 0;
   this.issuer = null;
   this.book = null;
   this.advertType = null;
   setExpiresIsSet(false);
   this.expires = 0;
   setPriceIsSet(false);
   this.price = 0.0;
   setWinnerIsSet(false);
   this.winner = 0;
 }
예제 #2
0
파일: Advert.java 프로젝트: kbence/booktion
 public Advert(
     int id,
     com.booktion.thrift.User issuer,
     com.booktion.thrift.Book book,
     com.booktion.thrift.AdvertType advertType,
     long expires,
     double price,
     int winner) {
   this();
   this.id = id;
   setIdIsSet(true);
   this.issuer = issuer;
   this.book = book;
   this.advertType = advertType;
   this.expires = expires;
   setExpiresIsSet(true);
   this.price = price;
   setPriceIsSet(true);
   this.winner = winner;
   setWinnerIsSet(true);
 }
예제 #3
0
파일: Advert.java 프로젝트: kbence/booktion
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, Advert struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(7);
   if (incoming.get(0)) {
     struct.id = iprot.readI32();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.issuer = new com.booktion.thrift.User();
     struct.issuer.read(iprot);
     struct.setIssuerIsSet(true);
   }
   if (incoming.get(2)) {
     struct.book = new com.booktion.thrift.Book();
     struct.book.read(iprot);
     struct.setBookIsSet(true);
   }
   if (incoming.get(3)) {
     struct.advertType = com.booktion.thrift.AdvertType.findByValue(iprot.readI32());
     struct.setAdvertTypeIsSet(true);
   }
   if (incoming.get(4)) {
     struct.expires = iprot.readI64();
     struct.setExpiresIsSet(true);
   }
   if (incoming.get(5)) {
     struct.price = iprot.readDouble();
     struct.setPriceIsSet(true);
   }
   if (incoming.get(6)) {
     struct.winner = iprot.readI32();
     struct.setWinnerIsSet(true);
   }
 }
예제 #4
0
파일: Advert.java 프로젝트: kbence/booktion
    public void read(org.apache.thrift.protocol.TProtocol iprot, Advert 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.id = iprot.readI32();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ISSUER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.issuer = new com.booktion.thrift.User();
              struct.issuer.read(iprot);
              struct.setIssuerIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // BOOK
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.book = new com.booktion.thrift.Book();
              struct.book.read(iprot);
              struct.setBookIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ADVERT_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.advertType = com.booktion.thrift.AdvertType.findByValue(iprot.readI32());
              struct.setAdvertTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // EXPIRES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.expires = iprot.readI64();
              struct.setExpiresIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PRICE
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.price = iprot.readDouble();
              struct.setPriceIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // WINNER
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.winner = iprot.readI32();
              struct.setWinnerIsSet(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();
    }
예제 #5
0
파일: Advert.java 프로젝트: kbence/booktion
 public Advert setPrice(double price) {
   this.price = price;
   setPriceIsSet(true);
   return this;
 }