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

COVERAGE SUMMARY FOR SOURCE FILE [NetworkConnectionSection.java]

nameclass, %method, %block, %line, %
NetworkConnectionSection.java100% (2/2)60%  (9/15)55%  (82/150)48%  (16.9/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NetworkConnectionSection100% (1/1)50%  (4/8)50%  (52/103)38%  (9.9/26)
equals (Object): boolean 0%   (0/1)0%   (0/39)0%   (0/13)
getIpAddress (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getNetwork (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): NetworkConnectionSection$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
hashCode (): int 100% (1/1)90%  (18/20)98%  (3.9/4)
NetworkConnectionSection (String, String, String): void 100% (1/1)100% (10/10)100% (4/4)
builder (): NetworkConnectionSection$Builder 100% (1/1)100% (4/4)100% (1/1)
toString (): String 100% (1/1)100% (20/20)100% (1/1)
     
class NetworkConnectionSection$Builder100% (1/1)71%  (5/7)64%  (30/47)78%  (7/9)
fromNetworkConectionSection (NetworkConnectionSection): NetworkConnectionSect... 0%   (0/1)0%   (0/10)0%   (0/1)
fromSection (Section): NetworkConnectionSection$Builder 0%   (0/1)0%   (0/7)0%   (0/1)
NetworkConnectionSection$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): NetworkConnectionSection 100% (1/1)100% (10/10)100% (1/1)
info (String): NetworkConnectionSection$Builder 100% (1/1)100% (7/7)100% (1/1)
ipAddress (String): NetworkConnectionSection$Builder 100% (1/1)100% (5/5)100% (2/2)
network (String): NetworkConnectionSection$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.savvis.vpdc.domain;
20 
21import org.jclouds.ovf.Section;
22 
23/**
24 * 
25 * @author Adrian Cole
26 */
27public class NetworkConnectionSection extends Section<NetworkConnectionSection> {
28 
29   @SuppressWarnings("unchecked")
30   public static Builder builder() {
31      return new Builder();
32   }
33 
34   /**
35    * {@inheritDoc}
36    */
37   @Override
38   public Builder toBuilder() {
39      return builder().fromNetworkConectionSection(this);
40   }
41 
42   public static class Builder extends Section.Builder<NetworkConnectionSection> {
43      private String network;
44      private String ipAddress;
45 
46      public Builder network(String network) {
47         this.network = network;
48         return this;
49      }
50 
51      public Builder ipAddress(String ipAddress) {
52         this.ipAddress = ipAddress;
53         return this;
54      }
55 
56      /**
57       * {@inheritDoc}
58       */
59      @Override
60      public NetworkConnectionSection build() {
61         return new NetworkConnectionSection(info, network, ipAddress);
62      }
63 
64      public Builder fromNetworkConectionSection(NetworkConnectionSection in) {
65         return fromSection(in).network(in.getNetwork()).ipAddress(in.getIpAddress());
66      }
67 
68      /**
69       * {@inheritDoc}
70       */
71      @Override
72      public Builder fromSection(Section<NetworkConnectionSection> in) {
73         return Builder.class.cast(super.fromSection(in));
74      }
75 
76      /**
77       * {@inheritDoc}
78       */
79      @Override
80      public Builder info(String info) {
81         return Builder.class.cast(super.info(info));
82      }
83 
84   }
85 
86   private final String network;
87   private final String ipAddress;
88 
89   public NetworkConnectionSection(String info, String network, String ipAddress) {
90      super(info);
91      this.network = network;
92      this.ipAddress = ipAddress;
93   }
94 
95   public String getNetwork() {
96      return network;
97   }
98 
99   public String getIpAddress() {
100      return ipAddress;
101   }
102 
103   @Override
104   public int hashCode() {
105      final int prime = 31;
106      int result = super.hashCode();
107      result = prime * result + ((network == null) ? 0 : network.hashCode());
108      return result;
109   }
110 
111   @Override
112   public boolean equals(Object obj) {
113      if (this == obj)
114         return true;
115      if (!super.equals(obj))
116         return false;
117      if (getClass() != obj.getClass())
118         return false;
119      NetworkConnectionSection other = (NetworkConnectionSection) obj;
120      if (network == null) {
121         if (other.network != null)
122            return false;
123      } else if (!network.equals(other.network))
124         return false;
125      return true;
126   }
127 
128   @Override
129   public String toString() {
130      return String.format("[info=%s, network=%s, ipAddress=%s]", info, network, ipAddress);
131   }
132 
133}

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