EMMA Coverage Report (generated Fri Aug 26 14:14:05 EDT 2011)
[all classes][org.jclouds.ec2.compute.domain]

COVERAGE SUMMARY FOR SOURCE FILE [RegionAndName.java]

nameclass, %method, %block, %line, %
RegionAndName.java100% (1/1)100% (6/6)83%  (97/117)76%  (22.8/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RegionAndName100% (1/1)100% (6/6)83%  (97/117)76%  (22.8/30)
equals (Object): boolean 100% (1/1)70%  (37/53)61%  (11/18)
hashCode (): int 100% (1/1)88%  (28/32)96%  (4.8/5)
RegionAndName (String, String): void 100% (1/1)100% (9/9)100% (4/4)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getRegion (): String 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (17/17)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.ec2.compute.domain;
20 
21/**
22 * 
23 * @author Adrian Cole
24 */
25public class RegionAndName {
26   protected final String region;
27   protected final String name;
28 
29   public RegionAndName(String region, String name) {
30      this.region = region;
31      this.name = name;
32   }
33 
34   @Override
35   public int hashCode() {
36      final int prime = 31;
37      int result = 1;
38      result = prime * result + ((region == null) ? 0 : region.hashCode());
39      result = prime * result + ((name == null) ? 0 : name.hashCode());
40      return result;
41   }
42 
43   @Override
44   public boolean equals(Object obj) {
45      if (this == obj)
46         return true;
47      if (obj == null)
48         return false;
49      if (getClass() != obj.getClass())
50         return false;
51      RegionAndName other = (RegionAndName) obj;
52      if (region == null) {
53         if (other.region != null)
54            return false;
55      } else if (!region.equals(other.region))
56         return false;
57      if (name == null) {
58         if (other.name != null)
59            return false;
60      } else if (!name.equals(other.name))
61         return false;
62      return true;
63   }
64 
65   public String getRegion() {
66      return region;
67   }
68 
69   public String getName() {
70      return name;
71   }
72 
73   @Override
74   public String toString() {
75      return "[region=" + region + ", name=" + name + "]";
76   }
77 
78}

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