package com.xrtb.bidder;

import com.xrtb.common.Campaign;
import com.xrtb.common.Creative;

/**
 * A class that is used to hold a campaign and the associated creative that matches a bid request. Used by the
 * CampaignProcessor to return the campaign+creative pair, which will then be used by the CampaignSelector to
 * make the BidResponse.
 * @author Ben M. Faul
 *
 */

public class SelectedCreative {
	public String dealId;
	public double price;
	public String impid;
	/** The campaign of the selection */
	Campaign campaign;
	/** The creative within the campaign that was selected */
	Creative creative;
	/** The cap specification, if present */
	String capSpec;
	
	/**
	 * Return the campaign of the selection.
	 * @return Campaign. The campaign.
	 */
	public Campaign getCampaign() {
		return campaign;
	}

	/**
	 * Returns the Creative that was selected out of the campaign
	 * @return Creative. The selected creative.
	 */
	public Creative getCreative() {
		return creative;
	}

	public double getPrice() {
		return price;
	}
	
	public String getDealId() {
		return dealId;
	}
	
	/**
	 * Assign a campaign
	 * @param campaign Campaign - the campaign to assign.
	 */
	public void setCampaign(Campaign campaign) {
		this.campaign = campaign;
	}
	
	public SelectedCreative(Creative creative,  String dealId, double price, String impid) {
		this.creative = creative;
		this.dealId = dealId;
		this.price = price;
		this.impid = impid;
	}
}

@@ -84,16 +84,49 @@
 reative;
+%0Aimport com.xrtb.pojo.Impression;
 %0A%0A/**%0A *
@@ -432,16 +432,40 @@
 ative %7B%0A
+%09Impression impression;%0A
 %09public 
@@ -1494,10 +1494,143 @@
 pid;%0A%09%7D%0A
+%09%0A%09public void setImpression(Impression imp) %7B%0A%09%09impression = imp;%0A%09%7D%0A%09%0A%09public Impression getImpression() %7B%0A%09%09return impression;%0A%09%7D%0A
 %7D%0A

Add multi impression support.