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

COVERAGE SUMMARY FOR SOURCE FILE [FirewallProtocols.java]

nameclass, %method, %block, %line, %
FirewallProtocols.java0%   (0/1)0%   (0/6)0%   (0/95)0%   (0/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FirewallProtocols0%   (0/1)0%   (0/6)0%   (0/95)0%   (0/24)
FirewallProtocols (boolean, boolean): void 0%   (0/1)0%   (0/9)0%   (0/4)
equals (Object): boolean 0%   (0/1)0%   (0/35)0%   (0/12)
hashCode (): int 0%   (0/1)0%   (0/28)0%   (0/5)
isTcp (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isUdp (): 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.firewall;
20 
21/**
22 * The Protocols element specifies the protocols to which firewall rules apply.
23 * 
24 * @since vcloud api 0.9 emulated for 0.8
25 * 
26 * 
27 */
28public class FirewallProtocols {
29   private final boolean tcp;
30   private final boolean udp;
31 
32   public FirewallProtocols(boolean tcp, boolean udp) {
33      this.tcp = tcp;
34      this.udp = udp;
35   }
36 
37   /**
38    * @return true if the firewall rules apply to the TCP protocol
39    */
40   public boolean isTcp() {
41      return tcp;
42   }
43 
44   /**
45    * @return true if the firewall rules apply to the UDP protocol
46    */
47   public boolean isUdp() {
48      return udp;
49   }
50 
51   @Override
52   public int hashCode() {
53      final int prime = 31;
54      int result = 1;
55      result = prime * result + (tcp ? 1231 : 1237);
56      result = prime * result + (udp ? 1231 : 1237);
57      return result;
58   }
59 
60   @Override
61   public boolean equals(Object obj) {
62      if (this == obj)
63         return true;
64      if (obj == null)
65         return false;
66      if (getClass() != obj.getClass())
67         return false;
68      FirewallProtocols other = (FirewallProtocols) obj;
69      if (tcp != other.tcp)
70         return false;
71      if (udp != other.udp)
72         return false;
73      return true;
74   }
75 
76   @Override
77   public String toString() {
78      return "Protocols [tcp=" + tcp + ", udp=" + udp + "]";
79   }
80 
81}

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