EMMA Coverage Report (generated Mon Oct 17 05:41:20 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 * 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 static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.List;
24 
25import org.jclouds.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