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

COVERAGE SUMMARY FOR SOURCE FILE [VCloudOperatingSystemSection.java]

nameclass, %method, %block, %line, %
VCloudOperatingSystemSection.java100% (1/1)75%  (6/8)40%  (84/211)36%  (16.6/46)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VCloudOperatingSystemSection100% (1/1)75%  (6/8)40%  (84/211)36%  (16.6/46)
equals (Object): boolean 0%   (0/1)0%   (0/87)0%   (0/28)
toString (): String 0%   (0/1)0%   (0/32)0%   (0/1)
hashCode (): int 100% (1/1)86%  (51/59)94%  (6.6/7)
VCloudOperatingSystemSection (Integer, String, String, String, URI, String, R... 100% (1/1)100% (21/21)100% (6/6)
getEdit (): ReferenceType 100% (1/1)100% (3/3)100% (1/1)
getHref (): URI 100% (1/1)100% (3/3)100% (1/1)
getType (): String 100% (1/1)100% (3/3)100% (1/1)
getVmwOsType (): String 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.vcloud.domain.ovf;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.net.URI;
24 
25import org.jclouds.javax.annotation.Nullable;
26 
27import org.jclouds.ovf.OperatingSystemSection;
28import org.jclouds.vcloud.domain.ReferenceType;
29 
30/**
31 * A description of the operating system supported by a virtual machine.
32 */
33public class VCloudOperatingSystemSection extends OperatingSystemSection {
34   protected final String type;
35   protected final URI href;
36   @Nullable
37   protected final String vmwOsType;
38   protected final ReferenceType edit;
39 
40   public VCloudOperatingSystemSection(@Nullable Integer id, @Nullable String info, @Nullable String description, String type,
41            URI href, @Nullable String vmwOsType, ReferenceType edit) {
42      super(id, info, description);
43      this.type = type;
44      this.href = href;
45      this.vmwOsType = vmwOsType;
46      this.edit = checkNotNull(edit, "edit");
47   }
48 
49   public String getType() {
50      return type;
51   }
52 
53   public URI getHref() {
54      return href;
55   }
56 
57   /**
58    * 
59    * @return VMware osType, if running on VMware
60    */
61   public String getVmwOsType() {
62      return vmwOsType;
63   }
64 
65   /**
66    * 
67    * @return edit link
68    */
69   public ReferenceType getEdit() {
70      return edit;
71   }
72 
73   @Override
74   public String toString() {
75      return "[href=" + getHref() + ", type=" + getType() + ", id=" + getId() + ", vmwOsType=" + getVmwOsType()
76               + ", description=" + getDescription() + "]";
77   }
78 
79   @Override
80   public int hashCode() {
81      final int prime = 31;
82      int result = super.hashCode();
83      result = prime * result + ((edit == null) ? 0 : edit.hashCode());
84      result = prime * result + ((href == null) ? 0 : href.hashCode());
85      result = prime * result + ((type == null) ? 0 : type.hashCode());
86      result = prime * result + ((vmwOsType == null) ? 0 : vmwOsType.hashCode());
87      return result;
88   }
89 
90   @Override
91   public boolean equals(Object obj) {
92      if (this == obj)
93         return true;
94      if (!super.equals(obj))
95         return false;
96      if (getClass() != obj.getClass())
97         return false;
98      VCloudOperatingSystemSection other = (VCloudOperatingSystemSection) obj;
99      if (edit == null) {
100         if (other.edit != null)
101            return false;
102      } else if (!edit.equals(other.edit))
103         return false;
104      if (href == null) {
105         if (other.href != null)
106            return false;
107      } else if (!href.equals(other.href))
108         return false;
109      if (type == null) {
110         if (other.type != null)
111            return false;
112      } else if (!type.equals(other.type))
113         return false;
114      if (vmwOsType == null) {
115         if (other.vmwOsType != null)
116            return false;
117      } else if (!vmwOsType.equals(other.vmwOsType))
118         return false;
119      return true;
120   }
121}

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