EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.vcloud.terremark.domain.internal]

COVERAGE SUMMARY FOR SOURCE FILE [TerremarkCatalogItemImpl.java]

nameclass, %method, %block, %line, %
TerremarkCatalogItemImpl.java100% (1/1)40%  (2/5)45%  (49/108)45%  (13/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TerremarkCatalogItemImpl100% (1/1)40%  (2/5)45%  (49/108)45%  (13/29)
getComputeOptions (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
getCustomizationOptions (): ReferenceType 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/33)0%   (0/5)
equals (Object): boolean 100% (1/1)64%  (35/55)50%  (9/18)
TerremarkCatalogItemImpl (String, URI, String, ReferenceType, ReferenceType, ... 100% (1/1)100% (14/14)100% (4/4)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.vcloud.terremark.domain.internal;
20 
21import java.net.URI;
22import java.util.Map;
23 
24import org.jclouds.vcloud.domain.ReferenceType;
25import org.jclouds.vcloud.domain.internal.CatalogItemImpl;
26import org.jclouds.vcloud.terremark.domain.TerremarkCatalogItem;
27 
28/**
29 * 
30 * @author Adrian Cole
31 * 
32 */
33public class TerremarkCatalogItemImpl extends CatalogItemImpl implements TerremarkCatalogItem {
34 
35   private final ReferenceType computeOptions;
36   private final ReferenceType customizationOptions;
37 
38   public TerremarkCatalogItemImpl(String name, URI id, String description, ReferenceType computeOptions,
39         ReferenceType customizationOptions, ReferenceType entity, Map<String, String> properties) {
40      super(name, id, description, entity, properties);
41      this.computeOptions = computeOptions;
42      this.customizationOptions = customizationOptions;
43   }
44 
45   @Override
46   public ReferenceType getComputeOptions() {
47      return computeOptions;
48   }
49 
50   @Override
51   public ReferenceType getCustomizationOptions() {
52      return customizationOptions;
53   }
54 
55   @Override
56   public int hashCode() {
57      final int prime = 31;
58      int result = super.hashCode();
59      result = prime * result + ((computeOptions == null) ? 0 : computeOptions.hashCode());
60      result = prime * result + ((customizationOptions == null) ? 0 : customizationOptions.hashCode());
61      return result;
62   }
63 
64   @Override
65   public boolean equals(Object obj) {
66      if (this == obj)
67         return true;
68      if (!super.equals(obj))
69         return false;
70      if (getClass() != obj.getClass())
71         return false;
72      TerremarkCatalogItemImpl other = (TerremarkCatalogItemImpl) obj;
73      if (computeOptions == null) {
74         if (other.computeOptions != null)
75            return false;
76      } else if (!computeOptions.equals(other.computeOptions))
77         return false;
78      if (customizationOptions == null) {
79         if (other.customizationOptions != null)
80            return false;
81      } else if (!customizationOptions.equals(other.customizationOptions))
82         return false;
83      return true;
84   }
85 
86}

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