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 [Subnet.java]

nameclass, %method, %block, %line, %
Subnet.java0%   (0/1)0%   (0/7)0%   (0/128)0%   (0/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Subnet0%   (0/1)0%   (0/7)0%   (0/128)0%   (0/31)
Subnet (URI, String): void 0%   (0/1)0%   (0/9)0%   (0/4)
compareTo (Subnet): int 0%   (0/1)0%   (0/11)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/53)0%   (0/18)
getHref (): URI 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/32)0%   (0/5)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/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.trmk.vcloud_0_8.domain;
20 
21import java.net.URI;
22 
23/**
24 * @author Seshu Pasam
25 */
26public class Subnet implements Comparable<Subnet> {
27   private final URI href;
28   private final String name;
29 
30   public Subnet(URI href, String name) {
31      this.href = href;
32      this.name = name;
33   }
34 
35   public int compareTo(Subnet that) {
36      return (this == that) ? 0 : getHref().compareTo(that.getHref());
37   }
38 
39   public URI getHref() {
40      return href;
41   }
42 
43   public String getName() {
44      return name;
45   }
46 
47   @Override
48   public int hashCode() {
49      final int prime = 31;
50      int result = 1;
51      result = prime * result + ((href == null) ? 0 : href.hashCode());
52      result = prime * result + ((name == null) ? 0 : name.hashCode());
53      return result;
54   }
55 
56   @Override
57   public boolean equals(Object obj) {
58      if (this == obj)
59         return true;
60      if (obj == null)
61         return false;
62      if (getClass() != obj.getClass())
63         return false;
64      Subnet other = (Subnet) obj;
65      if (href == null) {
66         if (other.href != null)
67            return false;
68      } else if (!href.equals(other.href))
69         return false;
70      if (name == null) {
71         if (other.name != null)
72            return false;
73      } else if (!name.equals(other.name))
74         return false;
75      return true;
76   }
77 
78   @Override
79   public String toString() {
80      return "[href=" + href + ", name=" + name + "]";
81   }
82}

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