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

COVERAGE SUMMARY FOR SOURCE FILE [DataCenter.java]

nameclass, %method, %block, %line, %
DataCenter.java100% (2/2)69%  (9/13)56%  (105/189)44%  (20.7/47)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DataCenter100% (1/1)50%  (4/8)48%  (77/161)33%  (12.7/39)
equals (Object): boolean 0%   (0/1)0%   (0/69)0%   (0/23)
getCode (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getId (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 100% (1/1)87%  (39/45)95%  (5.7/6)
DataCenter (String, String, String): void 100% (1/1)100% (12/12)100% (5/5)
builder (): DataCenter$Builder 100% (1/1)100% (4/4)100% (1/1)
toString (): String 100% (1/1)100% (22/22)100% (1/1)
     
class DataCenter$Builder100% (1/1)100% (5/5)100% (28/28)100% (8/8)
DataCenter$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): DataCenter 100% (1/1)100% (10/10)100% (1/1)
code (String): DataCenter$Builder 100% (1/1)100% (5/5)100% (2/2)
id (String): DataCenter$Builder 100% (1/1)100% (5/5)100% (2/2)
name (String): DataCenter$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.trmk.vcloud_0_8.domain;
20 
21 
22/**
23 * 
24 * @author Adrian Cole
25 */
26public class DataCenter {
27   public static Builder builder() {
28      return new Builder();
29   }
30 
31   public static class Builder {
32      private String id;
33      private String name;
34      private String code;
35 
36      public Builder id(String id) {
37         this.id = id;
38         return this;
39      }
40 
41      public Builder name(String name) {
42         this.name = name;
43         return this;
44      }
45 
46      public Builder code(String code) {
47         this.code = code;
48         return this;
49      }
50 
51      public DataCenter build() {
52         return new DataCenter(id, name, code);
53      }
54   }
55 
56   private final String id;
57   private final String name;
58   private final String code;
59 
60   public DataCenter(String id, String name, String code) {
61      this.id = id;
62      this.name = name;
63      this.code = code;
64   }
65 
66   /**
67    * 
68    * @return id of the data center
69    */
70   public String getId() {
71      return id;
72   }
73 
74   /**
75    * 
76    * @return name of the data center
77    */
78   public String getName() {
79      return name;
80   }
81 
82   /**
83    * 
84    * @return airport code of the data center
85    */
86   public String getCode() {
87      return code;
88   }
89 
90   @Override
91   public int hashCode() {
92      final int prime = 31;
93      int result = 1;
94      result = prime * result + ((code == null) ? 0 : code.hashCode());
95      result = prime * result + ((id == null) ? 0 : id.hashCode());
96      result = prime * result + ((name == null) ? 0 : name.hashCode());
97      return result;
98   }
99 
100   @Override
101   public boolean equals(Object obj) {
102      if (this == obj)
103         return true;
104      if (obj == null)
105         return false;
106      if (getClass() != obj.getClass())
107         return false;
108      DataCenter other = (DataCenter) obj;
109      if (code == null) {
110         if (other.code != null)
111            return false;
112      } else if (!code.equals(other.code))
113         return false;
114      if (id == null) {
115         if (other.id != null)
116            return false;
117      } else if (!id.equals(other.id))
118         return false;
119      if (name == null) {
120         if (other.name != null)
121            return false;
122      } else if (!name.equals(other.name))
123         return false;
124      return true;
125   }
126 
127   @Override
128   public String toString() {
129      return "[id=" + id + ", name=" + name + ", code=" + code + "]";
130   }
131}

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