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

COVERAGE SUMMARY FOR SOURCE FILE [IpRange.java]

nameclass, %method, %block, %line, %
IpRange.java100% (1/1)50%  (3/6)62%  (76/123)59%  (17.8/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IpRange100% (1/1)50%  (3/6)62%  (76/123)59%  (17.8/30)
getEndAddress (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getStartAddress (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/1)
equals (Object): boolean 100% (1/1)62%  (33/53)50%  (9/18)
hashCode (): int 100% (1/1)88%  (28/32)96%  (4.8/5)
IpRange (String, String): void 100% (1/1)100% (15/15)100% (4/4)

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 
23/**
24 * The IpRange element defines a range of IP addresses available on a network.
25 * 
26 */
27public class IpRange {
28   private final String startAddress;
29   private final String endAddress;
30 
31   public IpRange(String startAddress, String endAddress) {
32      this.startAddress = checkNotNull(startAddress, "startAddress");
33      this.endAddress = checkNotNull(endAddress, "endAddress");
34   }
35 
36   /**
37    * @return lowest IP address in the range
38    * 
39    * @since vcloud api 0.9
40    */
41   public String getStartAddress() {
42      return startAddress;
43   }
44 
45   /**
46    * @return highest IP address in the range
47    * 
48    * @since vcloud api 0.9
49    */
50   public String getEndAddress() {
51      return endAddress;
52   }
53 
54   @Override
55   public int hashCode() {
56      final int prime = 31;
57      int result = 1;
58      result = prime * result + ((endAddress == null) ? 0 : endAddress.hashCode());
59      result = prime * result + ((startAddress == null) ? 0 : startAddress.hashCode());
60      return result;
61   }
62 
63   @Override
64   public boolean equals(Object obj) {
65      if (this == obj)
66         return true;
67      if (obj == null)
68         return false;
69      if (getClass() != obj.getClass())
70         return false;
71      IpRange other = (IpRange) obj;
72      if (endAddress == null) {
73         if (other.endAddress != null)
74            return false;
75      } else if (!endAddress.equals(other.endAddress))
76         return false;
77      if (startAddress == null) {
78         if (other.startAddress != null)
79            return false;
80      } else if (!startAddress.equals(other.startAddress))
81         return false;
82      return true;
83   }
84 
85   @Override
86   public String toString() {
87      return "[startAddress=" + startAddress + ", endAddress=" + endAddress + "]";
88   }
89}

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