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

COVERAGE SUMMARY FOR SOURCE FILE [Features.java]

nameclass, %method, %block, %line, %
Features.java100% (1/1)57%  (4/7)13%  (21/157)21%  (8/38)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Features100% (1/1)57%  (4/7)13%  (21/157)21%  (8/38)
equals (Object): boolean 0%   (0/1)0%   (0/69)0%   (0/23)
hashCode (): int 0%   (0/1)0%   (0/45)0%   (0/6)
toString (): String 0%   (0/1)0%   (0/22)0%   (0/1)
Features (DhcpService, FirewallService, NatService): void 100% (1/1)100% (12/12)100% (5/5)
getDhcpService (): DhcpService 100% (1/1)100% (3/3)100% (1/1)
getFirewallService (): FirewallService 100% (1/1)100% (3/3)100% (1/1)
getNatService (): NatService 100% (1/1)100% (3/3)100% (1/1)

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.vcloud.domain.network;
20 
21import org.jclouds.javax.annotation.Nullable;
22 
23/**
24 * The Features element defines the DHCP and firewall features of a network.
25 */
26public class Features {
27   @Nullable
28   private final DhcpService dhcpService;
29   @Nullable
30   private final FirewallService firewallService;
31   @Nullable
32   private final NatService natService;
33 
34   public Features(@Nullable DhcpService dhcpService, @Nullable FirewallService firewallService,
35            @Nullable NatService natService) {
36      this.dhcpService = dhcpService;
37      this.firewallService = firewallService;
38      this.natService = natService;
39   }
40 
41   /**
42    * specifies the properties of the network?s DHCP service
43    * 
44    * @since vcloud api 0.9, but emulated for 0.8
45    */
46   @Nullable
47   public DhcpService getDhcpService() {
48      return dhcpService;
49   }
50 
51   /**
52    * defines the firewall service capabilities of the network
53    * 
54    * @since vcloud api 0.8
55    */
56   @Nullable
57   public FirewallService getFirewallService() {
58      return firewallService;
59   }
60 
61   /**
62    * defines the NAT service capabilities of the network
63    * 
64    * @since vcloud api 0.8
65    */
66   @Nullable
67   public NatService getNatService() {
68      return natService;
69   }
70 
71   @Override
72   public int hashCode() {
73      final int prime = 31;
74      int result = 1;
75      result = prime * result + ((dhcpService == null) ? 0 : dhcpService.hashCode());
76      result = prime * result + ((firewallService == null) ? 0 : firewallService.hashCode());
77      result = prime * result + ((natService == null) ? 0 : natService.hashCode());
78      return result;
79   }
80 
81   @Override
82   public boolean equals(Object obj) {
83      if (this == obj)
84         return true;
85      if (obj == null)
86         return false;
87      if (getClass() != obj.getClass())
88         return false;
89      Features other = (Features) obj;
90      if (dhcpService == null) {
91         if (other.dhcpService != null)
92            return false;
93      } else if (!dhcpService.equals(other.dhcpService))
94         return false;
95      if (firewallService == null) {
96         if (other.firewallService != null)
97            return false;
98      } else if (!firewallService.equals(other.firewallService))
99         return false;
100      if (natService == null) {
101         if (other.natService != null)
102            return false;
103      } else if (!natService.equals(other.natService))
104         return false;
105      return true;
106   }
107 
108   @Override
109   public String toString() {
110      return "[dhcpService=" + dhcpService + ", firewallService=" + firewallService + ", natService=" + natService
111               + "]";
112   }
113 
114}

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