EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.softlayer.domain]

COVERAGE SUMMARY FOR SOURCE FILE [ProductOrderReceipt.java]

nameclass, %method, %block, %line, %
ProductOrderReceipt.java0%   (0/2)0%   (0/15)0%   (0/136)0%   (0/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProductOrderReceipt0%   (0/1)0%   (0/10)0%   (0/104)0%   (0/27)
ProductOrderReceipt (): void 0%   (0/1)0%   (0/6)0%   (0/3)
ProductOrderReceipt (int, ProductOrder): void 0%   (0/1)0%   (0/12)0%   (0/5)
builder (): ProductOrderReceipt$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
compareTo (ProductOrderReceipt): int 0%   (0/1)0%   (0/10)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/28)0%   (0/10)
getOrderDetails (): ProductOrder 0%   (0/1)0%   (0/3)0%   (0/1)
getOrderId (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/18)0%   (0/4)
toBuilder (): ProductOrderReceipt$Builder 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/1)
     
class ProductOrderReceipt$Builder0%   (0/1)0%   (0/5)0%   (0/32)0%   (0/8)
ProductOrderReceipt$Builder (): void 0%   (0/1)0%   (0/6)0%   (0/2)
build (): ProductOrderReceipt 0%   (0/1)0%   (0/8)0%   (0/1)
fromAddress (ProductOrderReceipt): ProductOrderReceipt$Builder 0%   (0/1)0%   (0/8)0%   (0/1)
orderDetails (ProductOrder): ProductOrderReceipt$Builder 0%   (0/1)0%   (0/5)0%   (0/2)
orderId (int): ProductOrderReceipt$Builder 0%   (0/1)0%   (0/5)0%   (0/2)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.softlayer.domain;
20 
21/**
22 * 
23 * @author Jason King
24 * @see <a href= "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Receipt"
25 *      />
26 */
27public class ProductOrderReceipt implements Comparable<ProductOrderReceipt> {
28   public static Builder builder() {
29      return new Builder();
30   }
31 
32   public static class Builder {
33      private int orderId = -1;
34      private ProductOrder orderDetails;
35 
36      public Builder orderId(int orderId) {
37         this.orderId = orderId;
38         return this;
39      }
40 
41      public Builder orderDetails(ProductOrder orderDetails) {
42         this.orderDetails = orderDetails;
43         return this;
44      }
45 
46      public ProductOrderReceipt build() {
47         return new ProductOrderReceipt(orderId,orderDetails);
48      }
49 
50      public static Builder fromAddress(ProductOrderReceipt in) {
51         return ProductOrderReceipt.builder().orderId(in.getOrderId()).orderDetails(in.getOrderDetails());
52      }
53   }
54 
55   private int orderId = -1;
56   private ProductOrder orderDetails;
57 
58   // for deserializer
59   ProductOrderReceipt() {
60 
61   }
62 
63   public ProductOrderReceipt(int orderId,ProductOrder orderDetails) {
64      this.orderId = orderId;
65      this.orderDetails = orderDetails;
66   }
67 
68   @Override
69   public int compareTo(ProductOrderReceipt arg0) {
70      return new Integer(orderId).compareTo(arg0.getOrderId());
71   }
72 
73   /**
74    * @return unique identifier for the order.
75    */
76   public int getOrderId() {
77      return orderId;
78   }
79 
80   /**
81    * This is a copy of the SoftLayer_Container_Product_Order
82    * which holds all the data related to an order.
83    * This will only return when an order is processed successfully.
84    * It will contain all the items in an order as well as the order totals.
85    */
86   public ProductOrder getOrderDetails() {
87      return orderDetails;
88   }
89 
90   public Builder toBuilder() {
91      return Builder.fromAddress(this);
92   }
93 
94   @Override
95   public int hashCode() {
96      final int prime = 31;
97      int result = 1;
98      result = prime * result + (orderId ^ (orderId >>> 32));
99      return result;
100   }
101 
102   @Override
103   public boolean equals(Object obj) {
104      if (this == obj)
105         return true;
106      if (obj == null)
107         return false;
108      if (getClass() != obj.getClass())
109         return false;
110      ProductOrderReceipt other = (ProductOrderReceipt) obj;
111      if (orderId != other.orderId)
112         return false;
113      return true;
114   }
115 
116   @Override
117   public String toString() {
118      return "[orderId=" + orderId + ", orderDetails="+orderDetails+"]";
119   }
120   
121   
122}

[all classes][org.jclouds.softlayer.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov