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

COVERAGE SUMMARY FOR SOURCE FILE [StaticIPInfo.java]

nameclass, %method, %block, %line, %
StaticIPInfo.java0%   (0/2)0%   (0/18)0%   (0/474)0%   (0/108)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StaticIPInfo0%   (0/1)0%   (0/9)0%   (0/253)0%   (0/54)
StaticIPInfo (String, String, String, Iterable, String): void 0%   (0/1)0%   (0/34)0%   (0/7)
equals (Object): boolean 0%   (0/1)0%   (0/101)0%   (0/33)
getAddress (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getGateway (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getNameservers (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getNetmask (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getUser (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/71)0%   (0/8)
toString (): String 0%   (0/1)0%   (0/32)0%   (0/1)
     
class StaticIPInfo$Builder0%   (0/1)0%   (0/9)0%   (0/221)0%   (0/54)
StaticIPInfo$Builder (): void 0%   (0/1)0%   (0/6)0%   (0/2)
build (): StaticIPInfo 0%   (0/1)0%   (0/14)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/101)0%   (0/33)
gateway (String): StaticIPInfo$Builder 0%   (0/1)0%   (0/5)0%   (0/2)
hashCode (): int 0%   (0/1)0%   (0/71)0%   (0/8)
ip (String): StaticIPInfo$Builder 0%   (0/1)0%   (0/5)0%   (0/2)
nameservers (Iterable): StaticIPInfo$Builder 0%   (0/1)0%   (0/9)0%   (0/2)
netmask (String): StaticIPInfo$Builder 0%   (0/1)0%   (0/5)0%   (0/2)
user (String): StaticIPInfo$Builder 0%   (0/1)0%   (0/5)0%   (0/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.cloudsigma.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Set;
24 
25import org.jclouds.javax.annotation.Nullable;
26 
27import com.google.common.collect.ImmutableSet;
28 
29/**
30 * 
31 * @author Adrian Cole
32 */
33public class StaticIPInfo {
34   public static class Builder {
35      protected String ip;
36      protected String user;
37      protected String netmask;
38      protected Set<String> nameservers = ImmutableSet.of();
39      protected String gateway;
40 
41      public Builder ip(String ip) {
42         this.ip = ip;
43         return this;
44      }
45 
46      public Builder user(String user) {
47         this.user = user;
48         return this;
49      }
50 
51      public Builder nameservers(Iterable<String> nameservers) {
52         this.nameservers = ImmutableSet.copyOf(checkNotNull(nameservers, "nameservers"));
53         return this;
54      }
55 
56      public Builder gateway(String gateway) {
57         this.gateway = gateway;
58         return this;
59      }
60 
61      public Builder netmask(String netmask) {
62         this.netmask = netmask;
63         return this;
64      }
65 
66      public StaticIPInfo build() {
67         return new StaticIPInfo(ip, user, netmask, nameservers, gateway);
68      }
69 
70      @Override
71      public int hashCode() {
72         final int prime = 31;
73         int result = 1;
74         result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
75         result = prime * result + ((nameservers == null) ? 0 : nameservers.hashCode());
76         result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
77         result = prime * result + ((user == null) ? 0 : user.hashCode());
78         result = prime * result + ((ip == null) ? 0 : ip.hashCode());
79         return result;
80      }
81 
82      @Override
83      public boolean equals(Object obj) {
84         if (this == obj)
85            return true;
86         if (obj == null)
87            return false;
88         if (getClass() != obj.getClass())
89            return false;
90         Builder other = (Builder) obj;
91         if (gateway == null) {
92            if (other.gateway != null)
93               return false;
94         } else if (!gateway.equals(other.gateway))
95            return false;
96         if (nameservers == null) {
97            if (other.nameservers != null)
98               return false;
99         } else if (!nameservers.equals(other.nameservers))
100            return false;
101         if (netmask == null) {
102            if (other.netmask != null)
103               return false;
104         } else if (!netmask.equals(other.netmask))
105            return false;
106         if (user == null) {
107            if (other.user != null)
108               return false;
109         } else if (!user.equals(other.user))
110            return false;
111         if (ip == null) {
112            if (other.ip != null)
113               return false;
114         } else if (!ip.equals(other.ip))
115            return false;
116         return true;
117      }
118   }
119 
120   protected final String ip;
121   protected final String user;
122   protected final String netmask;
123   protected final Set<String> nameservers;
124   protected final String gateway;
125 
126   public StaticIPInfo(String ip, String user, String netmask, Iterable<String> nameservers, String gateway) {
127      this.ip = checkNotNull(ip, "ip");
128      this.user = checkNotNull(user, "user");
129      this.netmask = checkNotNull(netmask, "netmask");
130      this.nameservers = ImmutableSet.copyOf(checkNotNull(nameservers, "nameservers"));
131      this.gateway = checkNotNull(gateway, "gateway");
132   }
133 
134   /**
135    * 
136    * @return ip of the ip.
137    */
138   @Nullable
139   public String getAddress() {
140      return ip;
141   }
142 
143   /**
144    * 
145    * @return user owning the ip
146    */
147   public String getUser() {
148      return user;
149   }
150 
151   /**
152    * 
153    * @return netmask of the ip
154    */
155   public String getNetmask() {
156      return netmask;
157   }
158 
159   /**
160    * 
161    * @return nameservers of the ip
162    */
163   public Set<String> getNameservers() {
164      return nameservers;
165   }
166 
167   /**
168    * 
169    * @return gateway of the ip
170    */
171   public String getGateway() {
172      return gateway;
173   }
174 
175   @Override
176   public int hashCode() {
177      final int prime = 31;
178      int result = 1;
179      result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
180      result = prime * result + ((nameservers == null) ? 0 : nameservers.hashCode());
181      result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
182      result = prime * result + ((user == null) ? 0 : user.hashCode());
183      result = prime * result + ((ip == null) ? 0 : ip.hashCode());
184      return result;
185   }
186 
187   @Override
188   public boolean equals(Object obj) {
189      if (this == obj)
190         return true;
191      if (obj == null)
192         return false;
193      if (getClass() != obj.getClass())
194         return false;
195      StaticIPInfo other = (StaticIPInfo) obj;
196      if (gateway == null) {
197         if (other.gateway != null)
198            return false;
199      } else if (!gateway.equals(other.gateway))
200         return false;
201      if (nameservers == null) {
202         if (other.nameservers != null)
203            return false;
204      } else if (!nameservers.equals(other.nameservers))
205         return false;
206      if (netmask == null) {
207         if (other.netmask != null)
208            return false;
209      } else if (!netmask.equals(other.netmask))
210         return false;
211      if (user == null) {
212         if (other.user != null)
213            return false;
214      } else if (!user.equals(other.user))
215         return false;
216      if (ip == null) {
217         if (other.ip != null)
218            return false;
219      } else if (!ip.equals(other.ip))
220         return false;
221      return true;
222   }
223 
224   @Override
225   public String toString() {
226      return "[ip=" + ip + ", user=" + user + ", netmask=" + netmask + ", nameservers="
227            + nameservers + ", gateway=" + gateway + "]";
228   }
229 
230}

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