EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.vcloud.terremark.domain]

COVERAGE SUMMARY FOR SOURCE FILE [InternetService.java]

nameclass, %method, %block, %line, %
InternetService.java100% (1/1)23%  (3/13)59%  (193/327)57%  (39.6/70)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InternetService100% (1/1)23%  (3/13)59%  (193/327)57%  (39.6/70)
compareTo (InternetService): int 0%   (0/1)0%   (0/11)0%   (0/1)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getId (): URI 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getPort (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getProtocol (): Protocol 0%   (0/1)0%   (0/3)0%   (0/1)
getPublicIpAddress (): PublicIpAddress 0%   (0/1)0%   (0/3)0%   (0/1)
getTimeout (): int 0%   (0/1)0%   (0/3)0%   (0/1)
isEnabled (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/47)0%   (0/1)
equals (Object): boolean 100% (1/1)64%  (78/122)49%  (19/39)
hashCode (): int 100% (1/1)92%  (88/96)97%  (10.6/11)
InternetService (String, URI, PublicIpAddress, int, Protocol, boolean, int, S... 100% (1/1)100% (27/27)100% (10/10)

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.vcloud.terremark.domain;
20 
21import java.net.URI;
22 
23/**
24 * @author Adrian Cole
25 */
26public class InternetService implements Comparable<InternetService> {
27   private final String name;
28   private final URI id;
29   private final PublicIpAddress publicIpAddress;
30   private final int port;
31   private final Protocol protocol;
32   private final boolean enabled;
33   private final int timeout;
34   private final String description;
35 
36   public InternetService(String name, URI id, PublicIpAddress publicIpAddress, int port, Protocol protocol,
37         boolean enabled, int timeout, String description) {
38      this.name = name;
39      this.id = id;
40      this.publicIpAddress = publicIpAddress;
41      this.port = port;
42      this.protocol = protocol;
43      this.enabled = enabled;
44      this.timeout = timeout;
45      this.description = description;
46   }
47 
48   public PublicIpAddress getPublicIpAddress() {
49      return publicIpAddress;
50   }
51 
52   public int getPort() {
53      return port;
54   }
55 
56   public Protocol getProtocol() {
57      return protocol;
58   }
59 
60   public boolean isEnabled() {
61      return enabled;
62   }
63 
64   public int getTimeout() {
65      return timeout;
66   }
67 
68   public String getDescription() {
69      return description;
70   }
71 
72   public String getName() {
73      return name;
74   }
75 
76   public URI getId() {
77      return id;
78   }
79 
80   public int compareTo(InternetService that) {
81      return (this == that) ? 0 : getId().compareTo(that.getId());
82   }
83 
84   @Override
85   public String toString() {
86      return "InternetService [description=" + description + ", enabled=" + enabled + ", id=" + id + ", name="
87            + name + ", port=" + port + ", protocol=" + protocol + ", publicIpAddress=" + publicIpAddress
88            + ", timeout=" + timeout + "]";
89   }
90 
91   @Override
92   public int hashCode() {
93      final int prime = 31;
94      int result = 1;
95      result = prime * result + ((description == null) ? 0 : description.hashCode());
96      result = prime * result + (enabled ? 1231 : 1237);
97      result = prime * result + ((id == null) ? 0 : id.hashCode());
98      result = prime * result + ((name == null) ? 0 : name.hashCode());
99      result = prime * result + port;
100      result = prime * result + ((protocol == null) ? 0 : protocol.hashCode());
101      result = prime * result + ((publicIpAddress == null) ? 0 : publicIpAddress.hashCode());
102      result = prime * result + timeout;
103      return result;
104   }
105 
106   @Override
107   public boolean equals(Object obj) {
108      if (this == obj)
109         return true;
110      if (obj == null)
111         return false;
112      if (getClass() != obj.getClass())
113         return false;
114      InternetService other = (InternetService) obj;
115      if (description == null) {
116         if (other.description != null)
117            return false;
118      } else if (!description.equals(other.description))
119         return false;
120      if (enabled != other.enabled)
121         return false;
122      if (id == null) {
123         if (other.id != null)
124            return false;
125      } else if (!id.equals(other.id))
126         return false;
127      if (name == null) {
128         if (other.name != null)
129            return false;
130      } else if (!name.equals(other.name))
131         return false;
132      if (port != other.port)
133         return false;
134      if (protocol == null) {
135         if (other.protocol != null)
136            return false;
137      } else if (!protocol.equals(other.protocol))
138         return false;
139      if (publicIpAddress == null) {
140         if (other.publicIpAddress != null)
141            return false;
142      } else if (!publicIpAddress.equals(other.publicIpAddress))
143         return false;
144      if (timeout != other.timeout)
145         return false;
146      return true;
147   }
148 
149}

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