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

COVERAGE SUMMARY FOR SOURCE FILE [ProductItemCategory.java]

nameclass, %method, %block, %line, %
ProductItemCategory.java100% (2/2)59%  (10/17)61%  (96/157)74%  (29/39)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ProductItemCategory100% (1/1)55%  (6/11)61%  (70/115)76%  (22/29)
compareTo (ProductItemCategory): int 0%   (0/1)0%   (0/10)0%   (0/1)
getId (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): ProductItemCategory$Builder 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/22)0%   (0/1)
equals (Object): boolean 100% (1/1)86%  (24/28)80%  (8/10)
ProductItemCategory (): void 100% (1/1)100% (6/6)100% (3/3)
ProductItemCategory (int, String, String): void 100% (1/1)100% (15/15)100% (6/6)
builder (): ProductItemCategory$Builder 100% (1/1)100% (4/4)100% (1/1)
getCategoryCode (): String 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (18/18)100% (4/4)
     
class ProductItemCategory$Builder100% (1/1)67%  (4/6)62%  (26/42)70%  (7/10)
fromProductItemCategory (ProductItemCategory): ProductItemCategory$Builder 0%   (0/1)0%   (0/11)0%   (0/1)
name (String): ProductItemCategory$Builder 0%   (0/1)0%   (0/5)0%   (0/2)
ProductItemCategory$Builder (): void 100% (1/1)100% (6/6)100% (2/2)
build (): ProductItemCategory 100% (1/1)100% (10/10)100% (1/1)
categoryCode (String): ProductItemCategory$Builder 100% (1/1)100% (5/5)100% (2/2)
id (int): ProductItemCategory$Builder 100% (1/1)100% (5/5)100% (2/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 * The SoftLayer_Product_Item_Category data type contains
23 * general category information for prices.
24 * 
25 * @author Jason King
26 * @see <a href=
27 *      "http://sldn.softlayer.com/reference/datatypes/SoftLayer_Product_Item_Category"
28 *      />
29 */
30public class ProductItemCategory implements Comparable<ProductItemCategory> {
31 
32   // TODO there are more elements than this.
33 
34   public static Builder builder() {
35      return new Builder();
36   }
37 
38   public static class Builder {
39      private int id = -1;
40      private String name;
41      private String categoryCode;
42 
43      public Builder id(int id) {
44         this.id = id;
45         return this;
46      }
47 
48      public Builder name(String name) {
49         this.name = name;
50         return this;
51      }
52 
53      public Builder categoryCode(String categoryCode) {
54         this.categoryCode = categoryCode;
55         return this;
56      }
57 
58      public ProductItemCategory build() {
59         return new ProductItemCategory(id, name, categoryCode);
60      }
61 
62      public static Builder fromProductItemCategory(ProductItemCategory in) {
63         return ProductItemCategory.builder().id(in.getId())
64                                             .name(in.getName())
65                                             .categoryCode(in.getCategoryCode());
66      }
67   }
68 
69   private int id = -1;
70   private String name;
71   private String categoryCode;
72 
73   // for deserializer
74   ProductItemCategory() {
75 
76   }
77 
78   public ProductItemCategory(int id, String name, String categoryCode) {
79      this.id = id;
80      this.name = name;
81      this.categoryCode = categoryCode;
82   }
83 
84   @Override
85   public int compareTo(ProductItemCategory arg0) {
86      return new Integer(id).compareTo(arg0.getId());
87   }
88 
89   /**
90    * @return The unique identifier of a specific location.
91    */
92   public int getId() {
93      return id;
94   }
95 
96   /**
97    * @return The friendly, descriptive name of the category as seen on the order forms and on invoices.
98    */
99   public String getName() {
100      return name;
101   }
102 
103   /**
104    * @return The code used to identify this category.
105    */
106   public String getCategoryCode() {
107      return categoryCode;
108   }
109 
110   public Builder toBuilder() {
111      return Builder.fromProductItemCategory(this);
112   }
113 
114   @Override
115   public int hashCode() {
116      final int prime = 31;
117      int result = 1;
118      result = prime * result + (id ^ (id >>> 32));
119      return result;
120   }
121 
122   @Override
123   public boolean equals(Object obj) {
124      if (this == obj)
125         return true;
126      if (obj == null)
127         return false;
128      if (getClass() != obj.getClass())
129         return false;
130      ProductItemCategory other = (ProductItemCategory) obj;
131      if (id != other.id)
132         return false;
133      return true;
134   }
135 
136   @Override
137   public String toString() {
138      return "ProductItemCategory [id=" + id + ", name=" + name + ", categoryCode=" + categoryCode + "]";
139   }
140}

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