All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adgear.avro.openrtb.Deal Maven / Gradle / Ivy

Go to download

Test module for other Anoa modules, which exposes complex records (OpenRTB bid requests) through utility classes for use in unit tests within other Anoa modules (anoa-core, for instance).

The newest version!
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package com.adgear.avro.openrtb;  


/** 3.3.17 Direct Deals Object
A “deal” object constitutes a deal struck a priori between a buyer and a seller and indicates that this impression is available under the terms of that deal. */
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class Deal extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"Deal\",\"namespace\":\"com.adgear.avro.openrtb\",\"doc\":\"3.3.17 Direct Deals Object\\nA “deal” object constitutes a deal struck a priori between a buyer and a seller and indicates that this impression is available under the terms of that deal.\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"doc\":\"[1] A unique identifier for the direct deal.\"},{\"name\":\"bidfloor\",\"type\":\"double\",\"doc\":\"[2] Bid floor for this impression (in CPM of bidfloorcur).\",\"default\":0.0},{\"name\":\"bidfloorcur\",\"type\":\"string\",\"doc\":\"[3] If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO- 4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.\",\"default\":\"USD\"},{\"name\":\"wseat\",\"type\":[\"null\",{\"type\":\"array\",\"items\":\"string\"}],\"doc\":\"[4] Array of buyer seats allowed to bid on this Direct Deal. Seats are an optional feature of an exchange. For example, [“4”,”34”,”82”,”45”] indicates that only advertisers using these exchange seats are allowed to bid on this direct deal.\",\"default\":null},{\"name\":\"wadomain\",\"type\":[\"null\",{\"type\":\"array\",\"items\":\"string\"}],\"doc\":\"[5] Array of advertiser domains allowed to bid on this Direct Deal. For example, [“advertiser1.com”,”advertiser2.com”] indicates that only the listed advertisers are allowed to bid on this direct deal.\",\"default\":null},{\"name\":\"at\",\"type\":[\"null\",\"int\"],\"doc\":\"[6] Auction type. If “1”, then first price auction. If “2”, then second price auction. If “3”, the passed bidfloor indicates the apriori agreed upon deal price. Additional auction types can be defined as per the exchange’s business rules.\",\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** [1] A unique identifier for the direct deal. */
  @Deprecated public java.lang.CharSequence id;
  /** [2] Bid floor for this impression (in CPM of bidfloorcur). */
  @Deprecated public double bidfloor;
  /** [3] If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO- 4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange. */
  @Deprecated public java.lang.CharSequence bidfloorcur;
  /** [4] Array of buyer seats allowed to bid on this Direct Deal. Seats are an optional feature of an exchange. For example, [“4”,”34”,”82”,”45”] indicates that only advertisers using these exchange seats are allowed to bid on this direct deal. */
  @Deprecated public java.util.List wseat;
  /** [5] Array of advertiser domains allowed to bid on this Direct Deal. For example, [“advertiser1.com”,”advertiser2.com”] indicates that only the listed advertisers are allowed to bid on this direct deal. */
  @Deprecated public java.util.List wadomain;
  /** [6] Auction type. If “1”, then first price auction. If “2”, then second price auction. If “3”, the passed bidfloor indicates the apriori agreed upon deal price. Additional auction types can be defined as per the exchange’s business rules. */
  @Deprecated public java.lang.Integer at;

  /**
   * Default constructor.
   */
  public Deal() {}

  /**
   * All-args constructor.
   */
  public Deal(java.lang.CharSequence id, java.lang.Double bidfloor, java.lang.CharSequence bidfloorcur, java.util.List wseat, java.util.List wadomain, java.lang.Integer at) {
    this.id = id;
    this.bidfloor = bidfloor;
    this.bidfloorcur = bidfloorcur;
    this.wseat = wseat;
    this.wadomain = wadomain;
    this.at = at;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call. 
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return id;
    case 1: return bidfloor;
    case 2: return bidfloorcur;
    case 3: return wseat;
    case 4: return wadomain;
    case 5: return at;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call. 
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: id = (java.lang.CharSequence)value$; break;
    case 1: bidfloor = (java.lang.Double)value$; break;
    case 2: bidfloorcur = (java.lang.CharSequence)value$; break;
    case 3: wseat = (java.util.List)value$; break;
    case 4: wadomain = (java.util.List)value$; break;
    case 5: at = (java.lang.Integer)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'id' field.
   * [1] A unique identifier for the direct deal.
   */
  public java.lang.CharSequence getId() {
    return id;
  }

  /**
   * Sets the value of the 'id' field.
   * [1] A unique identifier for the direct deal.
   * @param value the value to set.
   */
  public void setId(java.lang.CharSequence value) {
    this.id = value;
  }

  /**
   * Gets the value of the 'bidfloor' field.
   * [2] Bid floor for this impression (in CPM of bidfloorcur).
   */
  public java.lang.Double getBidfloor() {
    return bidfloor;
  }

  /**
   * Sets the value of the 'bidfloor' field.
   * [2] Bid floor for this impression (in CPM of bidfloorcur).
   * @param value the value to set.
   */
  public void setBidfloor(java.lang.Double value) {
    this.bidfloor = value;
  }

  /**
   * Gets the value of the 'bidfloorcur' field.
   * [3] If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO- 4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
   */
  public java.lang.CharSequence getBidfloorcur() {
    return bidfloorcur;
  }

  /**
   * Sets the value of the 'bidfloorcur' field.
   * [3] If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO- 4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
   * @param value the value to set.
   */
  public void setBidfloorcur(java.lang.CharSequence value) {
    this.bidfloorcur = value;
  }

  /**
   * Gets the value of the 'wseat' field.
   * [4] Array of buyer seats allowed to bid on this Direct Deal. Seats are an optional feature of an exchange. For example, [“4”,”34”,”82”,”45”] indicates that only advertisers using these exchange seats are allowed to bid on this direct deal.
   */
  public java.util.List getWseat() {
    return wseat;
  }

  /**
   * Sets the value of the 'wseat' field.
   * [4] Array of buyer seats allowed to bid on this Direct Deal. Seats are an optional feature of an exchange. For example, [“4”,”34”,”82”,”45”] indicates that only advertisers using these exchange seats are allowed to bid on this direct deal.
   * @param value the value to set.
   */
  public void setWseat(java.util.List value) {
    this.wseat = value;
  }

  /**
   * Gets the value of the 'wadomain' field.
   * [5] Array of advertiser domains allowed to bid on this Direct Deal. For example, [“advertiser1.com”,”advertiser2.com”] indicates that only the listed advertisers are allowed to bid on this direct deal.
   */
  public java.util.List getWadomain() {
    return wadomain;
  }

  /**
   * Sets the value of the 'wadomain' field.
   * [5] Array of advertiser domains allowed to bid on this Direct Deal. For example, [“advertiser1.com”,”advertiser2.com”] indicates that only the listed advertisers are allowed to bid on this direct deal.
   * @param value the value to set.
   */
  public void setWadomain(java.util.List value) {
    this.wadomain = value;
  }

  /**
   * Gets the value of the 'at' field.
   * [6] Auction type. If “1”, then first price auction. If “2”, then second price auction. If “3”, the passed bidfloor indicates the apriori agreed upon deal price. Additional auction types can be defined as per the exchange’s business rules.
   */
  public java.lang.Integer getAt() {
    return at;
  }

  /**
   * Sets the value of the 'at' field.
   * [6] Auction type. If “1”, then first price auction. If “2”, then second price auction. If “3”, the passed bidfloor indicates the apriori agreed upon deal price. Additional auction types can be defined as per the exchange’s business rules.
   * @param value the value to set.
   */
  public void setAt(java.lang.Integer value) {
    this.at = value;
  }

  /** Creates a new Deal RecordBuilder */
  public static com.adgear.avro.openrtb.Deal.Builder newBuilder() {
    return new com.adgear.avro.openrtb.Deal.Builder();
  }
  
  /** Creates a new Deal RecordBuilder by copying an existing Builder */
  public static com.adgear.avro.openrtb.Deal.Builder newBuilder(com.adgear.avro.openrtb.Deal.Builder other) {
    return new com.adgear.avro.openrtb.Deal.Builder(other);
  }
  
  /** Creates a new Deal RecordBuilder by copying an existing Deal instance */
  public static com.adgear.avro.openrtb.Deal.Builder newBuilder(com.adgear.avro.openrtb.Deal other) {
    return new com.adgear.avro.openrtb.Deal.Builder(other);
  }

  /**
   * RecordBuilder for Deal instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.CharSequence id;
    private double bidfloor;
    private java.lang.CharSequence bidfloorcur;
    private java.util.List wseat;
    private java.util.List wadomain;
    private java.lang.Integer at;

    /** Creates a new Builder */
    private Builder() {
      super(com.adgear.avro.openrtb.Deal.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(com.adgear.avro.openrtb.Deal.Builder other) {
      super(other);
    }
    
    /** Creates a Builder by copying an existing Deal instance */
    private Builder(com.adgear.avro.openrtb.Deal other) {
      super(com.adgear.avro.openrtb.Deal.SCHEMA$);
      if (isValidValue(fields()[0], other.id)) {
        this.id = data().deepCopy(fields()[0].schema(), other.id);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.bidfloor)) {
        this.bidfloor = data().deepCopy(fields()[1].schema(), other.bidfloor);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.bidfloorcur)) {
        this.bidfloorcur = data().deepCopy(fields()[2].schema(), other.bidfloorcur);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.wseat)) {
        this.wseat = data().deepCopy(fields()[3].schema(), other.wseat);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.wadomain)) {
        this.wadomain = data().deepCopy(fields()[4].schema(), other.wadomain);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.at)) {
        this.at = data().deepCopy(fields()[5].schema(), other.at);
        fieldSetFlags()[5] = true;
      }
    }

    /** Gets the value of the 'id' field */
    public java.lang.CharSequence getId() {
      return id;
    }

    /** Sets the value of the 'id' field */
    public com.adgear.avro.openrtb.Deal.Builder setId(java.lang.CharSequence value) {
      validate(fields()[0], value);
      this.id = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'id' field has been set */
    public boolean hasId() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'id' field */
    public com.adgear.avro.openrtb.Deal.Builder clearId() {
      id = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'bidfloor' field */
    public java.lang.Double getBidfloor() {
      return bidfloor;
    }

    /** Sets the value of the 'bidfloor' field */
    public com.adgear.avro.openrtb.Deal.Builder setBidfloor(double value) {
      validate(fields()[1], value);
      this.bidfloor = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'bidfloor' field has been set */
    public boolean hasBidfloor() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'bidfloor' field */
    public com.adgear.avro.openrtb.Deal.Builder clearBidfloor() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /** Gets the value of the 'bidfloorcur' field */
    public java.lang.CharSequence getBidfloorcur() {
      return bidfloorcur;
    }

    /** Sets the value of the 'bidfloorcur' field */
    public com.adgear.avro.openrtb.Deal.Builder setBidfloorcur(java.lang.CharSequence value) {
      validate(fields()[2], value);
      this.bidfloorcur = value;
      fieldSetFlags()[2] = true;
      return this; 
    }
    
    /** Checks whether the 'bidfloorcur' field has been set */
    public boolean hasBidfloorcur() {
      return fieldSetFlags()[2];
    }
    
    /** Clears the value of the 'bidfloorcur' field */
    public com.adgear.avro.openrtb.Deal.Builder clearBidfloorcur() {
      bidfloorcur = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /** Gets the value of the 'wseat' field */
    public java.util.List getWseat() {
      return wseat;
    }

    /** Sets the value of the 'wseat' field */
    public com.adgear.avro.openrtb.Deal.Builder setWseat(java.util.List value) {
      validate(fields()[3], value);
      this.wseat = value;
      fieldSetFlags()[3] = true;
      return this; 
    }
    
    /** Checks whether the 'wseat' field has been set */
    public boolean hasWseat() {
      return fieldSetFlags()[3];
    }
    
    /** Clears the value of the 'wseat' field */
    public com.adgear.avro.openrtb.Deal.Builder clearWseat() {
      wseat = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /** Gets the value of the 'wadomain' field */
    public java.util.List getWadomain() {
      return wadomain;
    }

    /** Sets the value of the 'wadomain' field */
    public com.adgear.avro.openrtb.Deal.Builder setWadomain(java.util.List value) {
      validate(fields()[4], value);
      this.wadomain = value;
      fieldSetFlags()[4] = true;
      return this; 
    }
    
    /** Checks whether the 'wadomain' field has been set */
    public boolean hasWadomain() {
      return fieldSetFlags()[4];
    }
    
    /** Clears the value of the 'wadomain' field */
    public com.adgear.avro.openrtb.Deal.Builder clearWadomain() {
      wadomain = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    /** Gets the value of the 'at' field */
    public java.lang.Integer getAt() {
      return at;
    }

    /** Sets the value of the 'at' field */
    public com.adgear.avro.openrtb.Deal.Builder setAt(java.lang.Integer value) {
      validate(fields()[5], value);
      this.at = value;
      fieldSetFlags()[5] = true;
      return this; 
    }
    
    /** Checks whether the 'at' field has been set */
    public boolean hasAt() {
      return fieldSetFlags()[5];
    }
    
    /** Clears the value of the 'at' field */
    public com.adgear.avro.openrtb.Deal.Builder clearAt() {
      at = null;
      fieldSetFlags()[5] = false;
      return this;
    }

    @Override
    public Deal build() {
      try {
        Deal record = new Deal();
        record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]);
        record.bidfloor = fieldSetFlags()[1] ? this.bidfloor : (java.lang.Double) defaultValue(fields()[1]);
        record.bidfloorcur = fieldSetFlags()[2] ? this.bidfloorcur : (java.lang.CharSequence) defaultValue(fields()[2]);
        record.wseat = fieldSetFlags()[3] ? this.wseat : (java.util.List) defaultValue(fields()[3]);
        record.wadomain = fieldSetFlags()[4] ? this.wadomain : (java.util.List) defaultValue(fields()[4]);
        record.at = fieldSetFlags()[5] ? this.at : (java.lang.Integer) defaultValue(fields()[5]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy