EMMA Coverage Report (generated Mon Oct 17 05:41:20 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 * 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 * 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