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 [CatalogItemImpl.java]

nameclass, %method, %block, %line, %
CatalogItemImpl.java100% (1/1)20%  (2/10)33%  (90/270)41%  (23/56)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CatalogItemImpl100% (1/1)20%  (2/10)33%  (90/270)41%  (23/56)
getComputeOptions (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
getCustomizationOptions (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getEntity (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
getProperties (): Map 0%   (0/1)0%   (0/3)0%   (0/1)
getType (): String 0%   (0/1)0%   (0/2)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/72)0%   (0/8)
toString (): String 0%   (0/1)0%   (0/47)0%   (0/1)
equals (Object): boolean 100% (1/1)57%  (59/103)45%  (15/33)
CatalogItemImpl (String, URI, String, ReferenceType, ReferenceType, Reference... 100% (1/1)100% (31/31)100% (8/8)

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.Map;
25 
26import org.jclouds.trmk.vcloud_0_8.TerremarkVCloudMediaType;
27import org.jclouds.trmk.vcloud_0_8.domain.CatalogItem;
28import org.jclouds.trmk.vcloud_0_8.domain.ReferenceType;
29 
30import com.google.common.collect.Maps;
31 
32/**
33 * 
34 * @author Adrian Cole
35 * 
36 */
37public class CatalogItemImpl extends ReferenceTypeImpl implements CatalogItem {
38 
39   protected final String description;
40   protected final ReferenceType entity;
41   protected final Map<String, String> properties = Maps.newLinkedHashMap();
42   private final ReferenceType computeOptions;
43   private final ReferenceType customizationOptions;
44   
45   public CatalogItemImpl(String name, URI id, String description, ReferenceType computeOptions,
46         ReferenceType customizationOptions, ReferenceType entity, Map<String, String> properties)  {
47      super(name, TerremarkVCloudMediaType.CATALOGITEM_XML, id);
48      this.description = description;
49      this.entity = checkNotNull(entity, "entity");
50      this.properties.putAll(checkNotNull(properties, "properties"));
51      this.computeOptions = computeOptions;
52      this.customizationOptions = customizationOptions;
53   }
54 
55   @Override
56   public String getType() {
57      return TerremarkVCloudMediaType.CATALOGITEM_XML;
58   }
59 
60   public ReferenceType getEntity() {
61      return entity;
62   }
63 
64   @Override
65   public String getDescription() {
66      return description;
67   }
68 
69   public Map<String, String> getProperties() {
70      return properties;
71   }
72 
73   @Override
74   public ReferenceType getComputeOptions() {
75      return computeOptions;
76   }
77 
78   @Override
79   public ReferenceType getCustomizationOptions() {
80      return customizationOptions;
81   }
82 
83   @Override
84   public String toString() {
85      return "[id=" + getHref() + ", name=" + getName() + ", type=" + getType() + ", description=" + getDescription()
86            + ", entity=" + entity + ", computeOptions=" + computeOptions + ", customizationOptions="
87            + customizationOptions + ", properties=" + properties + "]";
88   }
89 
90   @Override
91   public int hashCode() {
92      final int prime = 31;
93      int result = super.hashCode();
94      result = prime * result + ((description == null) ? 0 : description.hashCode());
95      result = prime * result + ((entity == null) ? 0 : entity.hashCode());
96      result = prime * result + ((properties == null) ? 0 : properties.hashCode());
97      result = prime * result + ((computeOptions == null) ? 0 : computeOptions.hashCode());
98      result = prime * result + ((customizationOptions == null) ? 0 : customizationOptions.hashCode());
99      return result;
100   }
101 
102   @Override
103   public boolean equals(Object obj) {
104      if (this == obj)
105         return true;
106      if (!super.equals(obj))
107         return false;
108      if (getClass() != obj.getClass())
109         return false;
110      CatalogItemImpl other = (CatalogItemImpl) obj;
111      if (description == null) {
112         if (other.description != null)
113            return false;
114      } else if (!description.equals(other.description))
115         return false;
116      if (entity == null) {
117         if (other.entity != null)
118            return false;
119      } else if (!entity.equals(other.entity))
120         return false;
121      if (properties == null) {
122         if (other.properties != null)
123            return false;
124      } else if (!properties.equals(other.properties))
125         return false;
126      if (computeOptions == null) {
127         if (other.computeOptions != null)
128            return false;
129      } else if (!computeOptions.equals(other.computeOptions))
130         return false;
131      if (customizationOptions == null) {
132         if (other.customizationOptions != null)
133            return false;
134      } else if (!customizationOptions.equals(other.customizationOptions))
135         return false;
136      return true;
137   }
138 
139}

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