EMMA Coverage Report (generated Fri Apr 27 15:03:37 EDT 2012)
[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)85%  (99/117)79%  (23.8/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class RegionAndName100% (1/1)100% (6/6)85%  (99/117)79%  (23.8/30)
equals (Object): boolean 100% (1/1)74%  (39/53)67%  (12/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 * 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.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