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

COVERAGE SUMMARY FOR SOURCE FILE [Item.java]

nameclass, %method, %block, %line, %
Item.java100% (2/2)64%  (9/14)39%  (111/284)41%  (28.8/70)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Item$Builder100% (1/1)57%  (4/7)17%  (25/149)21%  (8/38)
build (): Item 0%   (0/1)0%   (0/10)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/69)0%   (0/23)
hashCode (): int 0%   (0/1)0%   (0/45)0%   (0/6)
Item$Builder (): void 100% (1/1)100% (6/6)100% (2/2)
name (String): Item$Builder 100% (1/1)100% (5/5)100% (2/2)
use (Iterable): Item$Builder 100% (1/1)100% (9/9)100% (2/2)
uuid (String): Item$Builder 100% (1/1)100% (5/5)100% (2/2)
     
class Item100% (1/1)71%  (5/7)64%  (86/135)65%  (20.8/32)
getUuid (): String 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)62%  (33/53)50%  (9/18)
hashCode (): int 100% (1/1)88%  (28/32)96%  (4.8/5)
Item (String, String, Iterable): void 100% (1/1)100% (19/19)100% (5/5)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getUse (): Set 100% (1/1)100% (3/3)100% (1/1)

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.cloudsigma.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Set;
24 
25import org.jclouds.javax.annotation.Nullable;
26 
27import com.google.common.collect.ImmutableSet;
28 
29/**
30 * 
31 * @author Adrian Cole
32 */
33public class Item {
34   public static class Builder {
35      protected String uuid;
36      protected String name;
37      protected Set<String> use = ImmutableSet.of();
38 
39      public Builder uuid(String uuid) {
40         this.uuid = uuid;
41         return this;
42      }
43 
44      public Builder name(String name) {
45         this.name = name;
46         return this;
47      }
48 
49      public Builder use(Iterable<String> use) {
50         this.use = ImmutableSet.copyOf(checkNotNull(use, "use"));
51         return this;
52      }
53 
54      public Item build() {
55         return new Item(uuid, name, use);
56      }
57 
58      @Override
59      public int hashCode() {
60         final int prime = 31;
61         int result = 1;
62         result = prime * result + ((name == null) ? 0 : name.hashCode());
63         result = prime * result + ((use == null) ? 0 : use.hashCode());
64         result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
65         return result;
66      }
67 
68      @Override
69      public boolean equals(Object obj) {
70         if (this == obj)
71            return true;
72         if (obj == null)
73            return false;
74         if (getClass() != obj.getClass())
75            return false;
76         Builder other = (Builder) obj;
77         if (name == null) {
78            if (other.name != null)
79               return false;
80         } else if (!name.equals(other.name))
81            return false;
82         if (use == null) {
83            if (other.use != null)
84               return false;
85         } else if (!use.equals(other.use))
86            return false;
87         if (uuid == null) {
88            if (other.uuid != null)
89               return false;
90         } else if (!uuid.equals(other.uuid))
91            return false;
92         return true;
93      }
94   }
95 
96   @Nullable
97   protected final String uuid;
98   protected final String name;
99   protected final Set<String> use;
100 
101   public Item(@Nullable String uuid, String name, Iterable<String> use) {
102      this.uuid = uuid;
103      this.name = checkNotNull(name, "name");
104      this.use = ImmutableSet.copyOf(checkNotNull(use, "use"));
105   }
106 
107   /**
108    * 
109    * @return uuid of the item.
110    */
111   @Nullable
112   public String getUuid() {
113      return uuid;
114   }
115 
116   /**
117    * 
118    * @return name of the item
119    */
120   public String getName() {
121      return name;
122   }
123 
124   /**
125    * 
126    * @return list of use
127    */
128   public Set<String> getUse() {
129      return use;
130   }
131 
132   @Override
133   public int hashCode() {
134      final int prime = 31;
135      int result = 1;
136      result = prime * result + ((name == null) ? 0 : name.hashCode());
137      result = prime * result + ((use == null) ? 0 : use.hashCode());
138      return result;
139   }
140 
141   @Override
142   public boolean equals(Object obj) {
143      if (this == obj)
144         return true;
145      if (obj == null)
146         return false;
147      if (getClass() != obj.getClass())
148         return false;
149      Item other = (Item) obj;
150      if (name == null) {
151         if (other.name != null)
152            return false;
153      } else if (!name.equals(other.name))
154         return false;
155      if (use == null) {
156         if (other.use != null)
157            return false;
158      } else if (!use.equals(other.use))
159         return false;
160 
161      return true;
162   }
163 
164   @Override
165   public String toString() {
166      return "[uuid=" + uuid + ", name=" + name + ", use=" + use + "]";
167   }
168 
169}

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