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

COVERAGE SUMMARY FOR SOURCE FILE [VAppImpl.java]

nameclass, %method, %block, %line, %
VAppImpl.java100% (1/1)72%  (13/18)39%  (201/521)49%  (52/106)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VAppImpl100% (1/1)72%  (13/18)39%  (201/521)49%  (52/106)
compareTo (ReferenceType): int 0%   (0/1)0%   (0/11)0%   (0/1)
getExtendedInfo (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getOsType (): Integer 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/149)0%   (0/14)
toString (): String 0%   (0/1)0%   (0/62)0%   (0/1)
equals (Object): boolean 100% (1/1)53%  (105/197)43%  (27/63)
VAppImpl (String, URI, Status, Long, ReferenceType, ListMultimap, Integer, St... 100% (1/1)100% (16/16)100% (2/2)
VAppImpl (String, URI, Status, Long, ReferenceType, ListMultimap, Integer, St... 100% (1/1)100% (51/51)100% (13/13)
getHref (): URI 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getNetworkToAddresses (): ListMultimap 100% (1/1)100% (3/3)100% (1/1)
getOperatingSystemDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getResourceAllocations (): Set 100% (1/1)100% (3/3)100% (1/1)
getSize (): Long 100% (1/1)100% (3/3)100% (1/1)
getStatus (): Status 100% (1/1)100% (3/3)100% (1/1)
getSystem (): VirtualSystemSettingData 100% (1/1)100% (3/3)100% (1/1)
getType (): String 100% (1/1)100% (2/2)100% (1/1)
getVDC (): ReferenceType 100% (1/1)100% (3/3)100% (1/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.trmk.vcloud_0_8.domain.internal;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.net.URI;
24import java.util.HashSet;
25import java.util.Set;
26 
27import org.jclouds.cim.ResourceAllocationSettingData;
28import org.jclouds.cim.VirtualSystemSettingData;
29import org.jclouds.trmk.vcloud_0_8.TerremarkVCloudMediaType;
30import org.jclouds.trmk.vcloud_0_8.domain.ReferenceType;
31import org.jclouds.trmk.vcloud_0_8.domain.Status;
32import org.jclouds.trmk.vcloud_0_8.domain.VApp;
33 
34import com.google.common.collect.ListMultimap;
35 
36/**
37 * 
38 * @author Adrian Cole
39 * 
40 */
41public class VAppImpl implements VApp {
42   private final String name;
43   private final URI href;
44   private final ReferenceType vDC;
45   private final Set<ReferenceType> extendedInfo;
46   private final Status status;
47   private final Long size;
48   private final ListMultimap<String, String> networkToAddresses;
49   private final String operatingSystemDescription;
50   private final VirtualSystemSettingData system;
51   private final Set<ResourceAllocationSettingData> resourceAllocations;
52   private final Integer osType;
53 
54   public VAppImpl(String name, URI href, Status status, Long size, ReferenceType vDC,
55            ListMultimap<String, String> networkToAddresses, Integer osType, String operatingSystemDescription,
56            VirtualSystemSettingData system, Set<ResourceAllocationSettingData> resourceAllocations) {
57       this(name, href, status, size, vDC, networkToAddresses, osType, operatingSystemDescription, system,
58               resourceAllocations, new HashSet<ReferenceType>());
59   }
60 
61   public VAppImpl(String name, URI href, Status status, Long size, ReferenceType vDC,
62            ListMultimap<String, String> networkToAddresses, Integer osType, String operatingSystemDescription,
63            VirtualSystemSettingData system, Set<ResourceAllocationSettingData> resourceAllocations,
64            Set<ReferenceType> extendedInfo) {
65      this.name = checkNotNull(name, "name");
66      this.href = checkNotNull(href, "href");
67      this.status = checkNotNull(status, "status");
68      this.size = size;
69      this.vDC = vDC;
70      this.networkToAddresses = checkNotNull(networkToAddresses, "networkToAddresses");
71      this.osType = osType;
72      this.operatingSystemDescription = operatingSystemDescription;
73      this.system = system;
74      this.resourceAllocations = checkNotNull(resourceAllocations, "resourceAllocations");
75      this.extendedInfo = extendedInfo;
76   }
77 
78   @Override
79   public Status getStatus() {
80      return status;
81   }
82 
83   @Override
84   public ListMultimap<String, String> getNetworkToAddresses() {
85      return networkToAddresses;
86   }
87 
88   @Override
89   public Integer getOsType() {
90      return osType;
91   }
92 
93   @Override
94   public String getOperatingSystemDescription() {
95      return operatingSystemDescription;
96   }
97 
98   @Override
99   public VirtualSystemSettingData getSystem() {
100      return system;
101   }
102 
103   @Override
104   public Set<ResourceAllocationSettingData> getResourceAllocations() {
105      return resourceAllocations;
106   }
107 
108   @Override
109   public ReferenceType getVDC() {
110      return vDC;
111   }
112 
113   @Override
114   public Set<ReferenceType> getExtendedInfo() {
115      return extendedInfo;
116   }
117 
118   @Override
119   public int hashCode() {
120      final int prime = 31;
121      int result = 1;
122      result = prime * result + ((href == null) ? 0 : href.hashCode());
123      result = prime * result + ((name == null) ? 0 : name.hashCode());
124      result = prime * result + ((networkToAddresses == null) ? 0 : networkToAddresses.hashCode());
125      result = prime * result + ((operatingSystemDescription == null) ? 0 : operatingSystemDescription.hashCode());
126      result = prime * result + ((resourceAllocations == null) ? 0 : resourceAllocations.hashCode());
127      result = prime * result + ((size == null) ? 0 : size.hashCode());
128      result = prime * result + ((osType == null) ? 0 : osType.hashCode());
129      result = prime * result + ((status == null) ? 0 : status.hashCode());
130      result = prime * result + ((system == null) ? 0 : system.hashCode());
131      result = prime * result + ((vDC == null) ? 0 : vDC.hashCode());
132      result = prime * result + ((extendedInfo == null) ? 0 : extendedInfo.hashCode());
133      return result;
134   }
135 
136   @Override
137   public boolean equals(Object obj) {
138      if (this == obj)
139         return true;
140      if (obj == null)
141         return false;
142      if (getClass() != obj.getClass())
143         return false;
144      VAppImpl other = (VAppImpl) obj;
145      if (href == null) {
146         if (other.href != null)
147            return false;
148      } else if (!href.equals(other.href))
149         return false;
150      if (name == null) {
151         if (other.name != null)
152            return false;
153      } else if (!name.equals(other.name))
154         return false;
155      if (osType == null) {
156         if (other.osType != null)
157            return false;
158      } else if (!osType.equals(other.osType))
159         return false;
160      if (networkToAddresses == null) {
161         if (other.networkToAddresses != null)
162            return false;
163      } else if (!networkToAddresses.equals(other.networkToAddresses))
164         return false;
165      if (operatingSystemDescription == null) {
166         if (other.operatingSystemDescription != null)
167            return false;
168      } else if (!operatingSystemDescription.equals(other.operatingSystemDescription))
169         return false;
170      if (resourceAllocations == null) {
171         if (other.resourceAllocations != null)
172            return false;
173      } else if (!resourceAllocations.equals(other.resourceAllocations))
174         return false;
175      if (size == null) {
176         if (other.size != null)
177            return false;
178      } else if (!size.equals(other.size))
179         return false;
180      if (status == null) {
181         if (other.status != null)
182            return false;
183      } else if (!status.equals(other.status))
184         return false;
185      if (system == null) {
186         if (other.system != null)
187            return false;
188      } else if (!system.equals(other.system))
189         return false;
190      if (vDC == null) {
191         if (other.vDC != null)
192            return false;
193      } else if (!vDC.equals(other.vDC))
194         return false;
195      if (extendedInfo == null) {
196         if (other.extendedInfo != null)
197            return false;
198      } else if (!extendedInfo.equals(other.extendedInfo))
199         return false;
200      return true;
201   }
202 
203   @Override
204   public String getName() {
205      return name;
206   }
207 
208   @Override
209   public URI getHref() {
210      return href;
211   }
212 
213   @Override
214   public Long getSize() {
215      return size;
216   }
217 
218   @Override
219   public String toString() {
220      return "[href=" + href + ", name=" + name + ", networkToAddresses=" + networkToAddresses + ", osType=" + osType
221               + ", operatingSystemDescription=" + operatingSystemDescription + ", resourceAllocationByType="
222               + resourceAllocations + ", size=" + size + ", status=" + status + ", system=" + system + ", vDC=" + vDC
223               + ", extendedInfo=" + extendedInfo + "]";
224   }
225 
226   @Override
227   public String getType() {
228      return TerremarkVCloudMediaType.VAPP_XML;
229   }
230 
231   @Override
232   public int compareTo(ReferenceType o) {
233      return (this == o) ? 0 : getHref().compareTo(o.getHref());
234   }
235 
236}

[all classes][org.jclouds.trmk.vcloud_0_8.domain.internal]
EMMA 2.0.5312 (C) Vladimir Roubtsov