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

COVERAGE SUMMARY FOR SOURCE FILE [Node.java]

nameclass, %method, %block, %line, %
Node.java100% (2/2)97%  (38/39)97%  (332/343)97%  (76/78)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Node100% (1/1)95%  (20/21)95%  (209/220)95%  (41/43)
hashCode (): int 0%   (0/1)0%   (0/9)0%   (0/1)
equals (Object): boolean 100% (1/1)80%  (8/10)67%  (2/3)
Node (String, String, String, String, String, String, String, String, String,... 100% (1/1)100% (52/52)100% (18/18)
builder (): Node$Builder 100% (1/1)100% (4/4)100% (1/1)
getCredential (): String 100% (1/1)100% (3/3)100% (1/1)
getCredentialUrl (): URI 100% (1/1)100% (3/3)100% (1/1)
getDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getGroup (): String 100% (1/1)100% (3/3)100% (1/1)
getHostname (): String 100% (1/1)100% (3/3)100% (1/1)
getId (): String 100% (1/1)100% (3/3)100% (1/1)
getLocationId (): String 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getOsArch (): String 100% (1/1)100% (3/3)100% (1/1)
getOsDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getOsFamily (): String 100% (1/1)100% (3/3)100% (1/1)
getOsVersion (): String 100% (1/1)100% (3/3)100% (1/1)
getSudoPassword (): String 100% (1/1)100% (3/3)100% (1/1)
getTags (): Set 100% (1/1)100% (22/22)100% (4/4)
getUsername (): String 100% (1/1)100% (3/3)100% (1/1)
isOs64Bit (): boolean 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (78/78)100% (1/1)
     
class Node$Builder100% (1/1)100% (18/18)100% (123/123)100% (35/35)
Node$Builder (): void 100% (1/1)100% (6/6)100% (2/2)
build (): Node 100% (1/1)100% (36/36)100% (1/1)
credential (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
credentialUrl (URI): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
description (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
group (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
hostname (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
id (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
locationId (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
name (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
os64Bit (boolean): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
osArch (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
osDescription (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
osFamily (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
osVersion (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
sudoPassword (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)
tags (Iterable): Node$Builder 100% (1/1)100% (6/6)100% (2/2)
username (String): Node$Builder 100% (1/1)100% (5/5)100% (2/2)

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.byon;
20 
21import java.net.URI;
22import java.util.HashSet;
23import java.util.Set;
24 
25import com.google.common.base.Objects;
26import com.google.common.collect.ImmutableSet;
27 
28/**
29 * 
30 * @author Adrian Cole
31 */
32public class Node {
33   public static Builder builder() {
34      return new Builder();
35   }
36 
37   public static class Builder {
38      private String id;
39      private String name;
40      private String description;
41      private String hostname;
42      private String locationId;
43      private String osArch;
44      private String osFamily;
45      private String osDescription;
46      private String osVersion;
47      private boolean os64Bit;
48      private String group;
49      private Set<String> tags = ImmutableSet.of();
50      private String username;
51      private String credential;
52      private URI credentialUrl;
53      private String sudoPassword;
54 
55      public Builder id(String id) {
56         this.id = id;
57         return this;
58      }
59 
60      public Builder name(String name) {
61         this.name = name;
62         return this;
63      }
64 
65      public Builder description(String description) {
66         this.description = description;
67         return this;
68      }
69 
70      public Builder hostname(String hostname) {
71         this.hostname = hostname;
72         return this;
73      }
74 
75      public Builder locationId(String locationId) {
76         this.locationId = locationId;
77         return this;
78      }
79 
80      public Builder osArch(String osArch) {
81         this.osArch = osArch;
82         return this;
83      }
84 
85      public Builder osFamily(String osFamily) {
86         this.osFamily = osFamily;
87         return this;
88      }
89 
90      public Builder osDescription(String osDescription) {
91         this.osDescription = osDescription;
92         return this;
93      }
94 
95      public Builder osVersion(String osVersion) {
96         this.osVersion = osVersion;
97         return this;
98      }
99 
100      public Builder os64Bit(boolean os64Bit) {
101         this.os64Bit = os64Bit;
102         return this;
103      }
104 
105      public Builder group(String group) {
106         this.group = group;
107         return this;
108      }
109 
110      public Builder tags(Iterable<String> tags) {
111         this.tags = ImmutableSet.copyOf(tags);
112         return this;
113      }
114 
115      public Builder username(String username) {
116         this.username = username;
117         return this;
118      }
119 
120      public Builder credential(String credential) {
121         this.credential = credential;
122         return this;
123      }
124 
125      public Builder credentialUrl(URI credentialUrl) {
126         this.credentialUrl = credentialUrl;
127         return this;
128      }
129 
130      public Builder sudoPassword(String sudoPassword) {
131         this.sudoPassword = sudoPassword;
132         return this;
133      }
134 
135      public Node build() {
136         return new Node(id, name, description, hostname, locationId, osArch, osFamily, osDescription, osVersion,
137                  os64Bit, group, tags, username, credential, credentialUrl, sudoPassword);
138      }
139   }
140 
141   public Node(String id, String name, String description, String hostname, String locationId, String osArch,
142            String osFamily, String osDescription, String osVersion, boolean os64Bit, String group,
143            Iterable<String> tags, String username, String credential, URI credentialUrl, String sudoPassword) {
144      this.id = id;
145      this.name = name;
146      this.description = description;
147      this.hostname = hostname;
148      this.locationId = locationId;
149      this.osArch = osArch;
150      this.osFamily = osFamily;
151      this.osDescription = osDescription;
152      this.osVersion = osVersion;
153      this.os64Bit = os64Bit;
154      this.group = group;
155      this.tags = ImmutableSet.copyOf(tags);
156      this.username = username;
157      this.credential = credential;
158      this.credentialUrl = credentialUrl;
159      this.sudoPassword = sudoPassword;
160   }
161 
162   private final String id;
163   private final String name;
164   private final String description;
165   private final String hostname;
166   private final String locationId;
167   private final String osArch;
168   private final String osFamily;
169   private final String osDescription;
170   private final String osVersion;
171   private final boolean os64Bit;
172   private final String group;
173   private final Set<String> tags;
174   private final String username;
175   private final String credential;
176   private final URI credentialUrl;
177   private final String sudoPassword;
178 
179   public String getId() {
180      return id;
181   }
182 
183   public String getLocationId() {
184      return locationId;
185   }
186 
187   public String getName() {
188      return name;
189   }
190 
191   public String getDescription() {
192      return description;
193   }
194 
195   public String getGroup() {
196      return group;
197   }
198 
199   public String getHostname() {
200      return hostname;
201   }
202 
203   public String getOsArch() {
204      return osArch;
205   }
206 
207   public String getOsFamily() {
208      return osFamily;
209   }
210 
211   public String getOsDescription() {
212      return osDescription;
213   }
214 
215   public String getOsVersion() {
216      return osVersion;
217   }
218 
219   public boolean isOs64Bit() {
220      return os64Bit;
221   }
222 
223   public Set<String> getTags() {
224      Set<String> tagSet = new HashSet<String>();
225      for (String tag : tags)
226         tagSet.add(tag);
227      return tagSet;
228   }
229 
230   public String getUsername() {
231      return username;
232   }
233 
234   public String getCredential() {
235      return credential;
236   }
237 
238   public URI getCredentialUrl() {
239      return credentialUrl;
240   }
241 
242   public String getSudoPassword() {
243      return sudoPassword;
244   }
245 
246   @Override
247   public int hashCode() {
248      return Objects.hashCode(id);
249   }
250 
251   @Override
252   public boolean equals(Object that) {
253      if (that == null)
254         return false;
255      return Objects.equal(this.toString(), that.toString());
256   }
257 
258   @Override
259   public String toString() {
260      return Objects.toStringHelper(this).add("id", id).add("name", name).add("description", description).add(
261               "locationId", locationId).add("hostname", hostname).add("osArch", osArch).add("osFamily", osFamily).add(
262               "osDescription", osDescription).add("osVersion", osVersion).add("os64Bit", os64Bit).add("group", group)
263               .add("tags", tags).add("username", username).add("hasCredential",
264                        credential != null || credentialUrl != null).add("hasSudoPassword", sudoPassword != null)
265               .toString();
266   }
267 
268}

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