1   package com.atlassian.maven.plugins.amps;
2   
3   import com.atlassian.maven.plugins.amps.product.ProductHandler;
4   import com.google.common.base.Preconditions;
5   
6   /**
7    * The execution context for a product
8    */
9   public class ProductExecution
10  {
11      private final Product product;
12      private final ProductHandler productHandler;
13  
14      /**
15       * Create a pair {product,handler}
16       * @param product the product, never null
17       * @param productHandler the handler, never null
18       */
19      public ProductExecution(Product product, ProductHandler productHandler)
20      {
21          Preconditions.checkArgument(product != null, "Can't instanciate a ProductExecution with no product");
22          Preconditions.checkArgument(productHandler != null, "Can't instanciate a ProductExecution with no handler");
23  
24          this.product = product;
25          this.productHandler = productHandler;
26      }
27  
28      /**
29       * @return the product handler, never null
30       */
31      public ProductHandler getProductHandler()
32      {
33          return productHandler;
34      }
35  
36      /**
37       * @return the product, never null
38       */
39      public Product getProduct()
40      {
41          return product;
42      }
43  
44      @Override
45      public String toString()
46      {
47          return "ProductExecution [product=" + product + ", productHandler=" + productHandler + "]";
48      }
49  
50  
51  }