EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.ovf]

COVERAGE SUMMARY FOR SOURCE FILE [Network.java]

nameclass, %method, %block, %line, %
Network.java100% (2/2)75%  (9/12)70%  (105/150)63%  (23.9/38)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Network100% (1/1)71%  (5/7)69%  (84/121)58%  (17.9/31)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)45%  (24/53)39%  (7/18)
hashCode (): int 100% (1/1)94%  (30/32)98%  (4.9/5)
Network (String, String): void 100% (1/1)100% (9/9)100% (4/4)
builder (): Network$Builder 100% (1/1)100% (4/4)100% (1/1)
toString (): String 100% (1/1)100% (17/17)100% (1/1)
     
class Network$Builder100% (1/1)80%  (4/5)72%  (21/29)86%  (6/7)
fromNetwork (Network): Network$Builder 0%   (0/1)0%   (0/8)0%   (0/1)
Network$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): Network 100% (1/1)100% (8/8)100% (1/1)
description (String): Network$Builder 100% (1/1)100% (5/5)100% (2/2)
name (String): Network$Builder 100% (1/1)100% (5/5)100% (2/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.ovf;
20 
21 
22/**
23 * 
24 * @author Adrian Cole
25 */
26public class Network {
27   public static Builder builder() {
28      return new Builder();
29   }
30 
31   public static class Builder {
32      protected String name;
33      protected String description;
34 
35      /**
36       * @see Network#getName
37       */
38      public Builder name(String name) {
39         this.name = name;
40         return this;
41      }
42 
43      /**
44       * @see Section#getDescription
45       */
46      public Builder description(String description) {
47         this.description = description;
48         return this;
49      }
50 
51      public Network build() {
52         return new Network(name, description);
53      }
54 
55      public Builder fromNetwork(Network in) {
56         return name(in.getName()).description(in.getDescription());
57      }
58   }
59 
60   private final String name;
61   private final String description;
62 
63   public Network(String name, String description) {
64      this.name = name;
65      this.description = description;
66   }
67 
68   @Override
69   public int hashCode() {
70      final int prime = 31;
71      int result = 1;
72      result = prime * result + ((description == null) ? 0 : description.hashCode());
73      result = prime * result + ((name == null) ? 0 : name.hashCode());
74      return result;
75   }
76 
77   @Override
78   public boolean equals(Object obj) {
79      if (this == obj)
80         return true;
81      if (obj == null)
82         return false;
83      if (getClass() != obj.getClass())
84         return false;
85      Network other = (Network) obj;
86      if (description == null) {
87         if (other.description != null)
88            return false;
89      } else if (!description.equals(other.description))
90         return false;
91      if (name == null) {
92         if (other.name != null)
93            return false;
94      } else if (!name.equals(other.name))
95         return false;
96      return true;
97   }
98 
99   @Override
100   public String toString() {
101      return "[name=" + name + ", description=" + description + "]";
102   }
103 
104   public String getName() {
105      return name;
106   }
107 
108   public String getDescription() {
109      return description;
110   }
111}

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