EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.vcloud.domain.network]

COVERAGE SUMMARY FOR SOURCE FILE [DhcpService.java]

nameclass, %method, %block, %line, %
DhcpService.java100% (1/1)25%  (2/8)33%  (62/186)42%  (18/43)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DhcpService100% (1/1)25%  (2/8)33%  (62/186)42%  (18/43)
getDefaultLeaseTime (): Integer 0%   (0/1)0%   (0/3)0%   (0/1)
getIpRange (): IpRange 0%   (0/1)0%   (0/3)0%   (0/1)
getMaxLeaseTime (): Integer 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/56)0%   (0/7)
isEnabled (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/27)0%   (0/1)
equals (Object): boolean 100% (1/1)62%  (47/76)48%  (12/25)
DhcpService (boolean, Integer, Integer, IpRange): void 100% (1/1)100% (15/15)100% (6/6)

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 javax.annotation.Nullable;
22 
23/**
24 * specifies the properties of the network?s DHCP service
25 */
26public class DhcpService {
27   private final boolean enabled;
28   @Nullable
29   private final Integer defaultLeaseTime;
30   @Nullable
31   private final Integer maxLeaseTime;
32   @Nullable
33   private final IpRange ipRange;
34 
35   public DhcpService(boolean enabled, @Nullable Integer defaultLeaseTime, @Nullable Integer maxLeaseTime,
36            @Nullable IpRange ipRange) {
37      this.enabled = enabled;
38      this.defaultLeaseTime = defaultLeaseTime;
39      this.maxLeaseTime = maxLeaseTime;
40      this.ipRange = ipRange;
41   }
42 
43   /**
44    * @return true if the service is enabled
45    * 
46    * @since vcloud api 0.8
47    */
48   public boolean isEnabled() {
49      return enabled;
50   }
51 
52   /**
53    * default duration of a DCHP address lease
54    * 
55    * @since vcloud api 0.9
56    */
57   @Nullable
58   public Integer getDefaultLeaseTime() {
59      return defaultLeaseTime;
60   }
61 
62   /**
63    * maximum duration of a DCHP address lease.
64    * 
65    * @since vcloud api 0.9
66    */
67   @Nullable
68   public Integer getMaxLeaseTime() {
69      return maxLeaseTime;
70   }
71 
72   /**
73    * @return range of IP addresses available to DHCP clients
74    * 
75    * @since vcloud api 0.9
76    */
77   @Nullable
78   public IpRange getIpRange() {
79      return ipRange;
80   }
81 
82   @Override
83   public int hashCode() {
84      final int prime = 31;
85      int result = 1;
86      result = prime * result + ((defaultLeaseTime == null) ? 0 : defaultLeaseTime.hashCode());
87      result = prime * result + (enabled ? 1231 : 1237);
88      result = prime * result + ((ipRange == null) ? 0 : ipRange.hashCode());
89      result = prime * result + ((maxLeaseTime == null) ? 0 : maxLeaseTime.hashCode());
90      return result;
91   }
92 
93   @Override
94   public boolean equals(Object obj) {
95      if (this == obj)
96         return true;
97      if (obj == null)
98         return false;
99      if (getClass() != obj.getClass())
100         return false;
101      DhcpService other = (DhcpService) obj;
102      if (defaultLeaseTime == null) {
103         if (other.defaultLeaseTime != null)
104            return false;
105      } else if (!defaultLeaseTime.equals(other.defaultLeaseTime))
106         return false;
107      if (enabled != other.enabled)
108         return false;
109      if (ipRange == null) {
110         if (other.ipRange != null)
111            return false;
112      } else if (!ipRange.equals(other.ipRange))
113         return false;
114      if (maxLeaseTime == null) {
115         if (other.maxLeaseTime != null)
116            return false;
117      } else if (!maxLeaseTime.equals(other.maxLeaseTime))
118         return false;
119      return true;
120   }
121 
122   @Override
123   public String toString() {
124      return "[defaultLeaseTime=" + defaultLeaseTime + ", enabled=" + enabled + ", ipRange=" + ipRange
125               + ", maxLeaseTime=" + maxLeaseTime + "]";
126   }
127}

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