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

COVERAGE SUMMARY FOR SOURCE FILE [TerremarkVCloudExpressNetwork.java]

nameclass, %method, %block, %line, %
TerremarkVCloudExpressNetwork.java100% (1/1)33%  (2/6)30%  (55/186)43%  (13/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TerremarkVCloudExpressNetwork100% (1/1)33%  (2/6)30%  (55/186)43%  (13/30)
getIps (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
getNetworkExtension (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/33)0%   (0/5)
toString (): String 0%   (0/1)0%   (0/72)0%   (0/1)
equals (Object): boolean 100% (1/1)64%  (35/55)50%  (9/18)
TerremarkVCloudExpressNetwork (String, String, URI, String, Set, String, Stri... 100% (1/1)100% (20/20)100% (4/4)

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.internal;
20 
21import java.net.URI;
22import java.util.Set;
23 
24import org.jclouds.vcloud.domain.ReferenceType;
25import org.jclouds.vcloud.domain.network.FenceMode;
26import org.jclouds.vcloud.domain.network.firewall.FirewallRule;
27import org.jclouds.vcloud.domain.network.internal.VCloudExpressNetworkImpl;
28import org.jclouds.vcloud.domain.network.nat.rules.PortForwardingRule;
29 
30/**
31 * Locations of resources in vCloud
32 * 
33 * @author Adrian Cole
34 * 
35 */
36public class TerremarkVCloudExpressNetwork extends VCloudExpressNetworkImpl {
37   private final ReferenceType networkExtension;
38   private final ReferenceType ips;
39 
40   public TerremarkVCloudExpressNetwork(String name, String type, URI id, String description, Set<String> dnsServers,
41            String gateway, String netmask, Set<FenceMode> fenceModes, Boolean dhcp, Set<PortForwardingRule> natRules,
42            Set<FirewallRule> firewallRules, ReferenceType networkExtension, ReferenceType ips) {
43      super(name, type, id, description, dnsServers, gateway, netmask, fenceModes, dhcp, natRules, firewallRules);
44      this.networkExtension = networkExtension;
45      this.ips = ips;
46   }
47 
48   public ReferenceType getNetworkExtension() {
49      return networkExtension;
50   }
51 
52   public ReferenceType getIps() {
53      return ips;
54   }
55 
56   @Override
57   public int hashCode() {
58      final int prime = 31;
59      int result = super.hashCode();
60      result = prime * result + ((ips == null) ? 0 : ips.hashCode());
61      result = prime * result + ((networkExtension == null) ? 0 : networkExtension.hashCode());
62      return result;
63   }
64 
65   @Override
66   public boolean equals(Object obj) {
67      if (this == obj)
68         return true;
69      if (!super.equals(obj))
70         return false;
71      if (getClass() != obj.getClass())
72         return false;
73      TerremarkVCloudExpressNetwork other = (TerremarkVCloudExpressNetwork) obj;
74      if (ips == null) {
75         if (other.ips != null)
76            return false;
77      } else if (!ips.equals(other.ips))
78         return false;
79      if (networkExtension == null) {
80         if (other.networkExtension != null)
81            return false;
82      } else if (!networkExtension.equals(other.networkExtension))
83         return false;
84      return true;
85   }
86 
87   @Override
88   public String toString() {
89      return "[id=" + getHref() + ", name=" + getName() + ", type=" + getType() + ", description=" + description
90               + ", dhcp=" + dhcp + ", dnsServers=" + dnsServers + ", fenceModes=" + fenceModes + ", firewallRules="
91               + firewallRules + ", gateway=" + gateway + ", natRules=" + natRules + ", netmask=" + netmask + ",ips="
92               + ips + ", networkExtension=" + networkExtension + "]";
93   }
94}

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