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

COVERAGE SUMMARY FOR SOURCE FILE [FirewallService.java]

nameclass, %method, %block, %line, %
FirewallService.java0%   (0/1)0%   (0/6)0%   (0/114)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FirewallService0%   (0/1)0%   (0/6)0%   (0/114)0%   (0/28)
FirewallService (boolean, Iterable): void 0%   (0/1)0%   (0/17)0%   (0/5)
equals (Object): boolean 0%   (0/1)0%   (0/44)0%   (0/15)
getFirewallRules (): List 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/30)0%   (0/5)
isEnabled (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/1)

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.domain.network;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.List;
24 
25import javax.annotation.Nullable;
26 
27import org.jclouds.vcloud.domain.network.firewall.FirewallRule;
28 
29import com.google.common.collect.Iterables;
30import com.google.common.collect.Lists;
31 
32/**
33 * The FirewallService element defines the firewall service capabilities of a network.
34 */
35public class FirewallService {
36   private final boolean enabled;
37 
38   List<FirewallRule> firewallRules = Lists.newArrayList();
39 
40   public FirewallService(boolean enabled, Iterable<? extends FirewallRule> firewallRules) {
41      this.enabled = enabled;
42      Iterables.addAll(this.firewallRules, checkNotNull(firewallRules, "firewallRules"));
43   }
44 
45   /**
46    * @return Firewall rules for the network
47    * 
48    * @since vcloud api 0.8
49    */
50   public List<? extends FirewallRule> getFirewallRules() {
51      return firewallRules;
52   }
53 
54   /**
55    * @return true if the service is enabled
56    * 
57    * @since vcloud api 0.9
58    */
59   @Nullable
60   public boolean isEnabled() {
61      return enabled;
62   }
63 
64   @Override
65   public int hashCode() {
66      final int prime = 31;
67      int result = 1;
68      result = prime * result + (enabled ? 1231 : 1237);
69      result = prime * result + ((firewallRules == null) ? 0 : firewallRules.hashCode());
70      return result;
71   }
72 
73   @Override
74   public boolean equals(Object obj) {
75      if (this == obj)
76         return true;
77      if (obj == null)
78         return false;
79      if (getClass() != obj.getClass())
80         return false;
81      FirewallService other = (FirewallService) obj;
82      if (enabled != other.enabled)
83         return false;
84      if (firewallRules == null) {
85         if (other.firewallRules != null)
86            return false;
87      } else if (!firewallRules.equals(other.firewallRules))
88         return false;
89      return true;
90   }
91 
92   @Override
93   public String toString() {
94      return "[enabled=" + enabled + ", firewallRules=" + firewallRules + "]";
95   }
96 
97}

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