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