EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.trmk.vcloud_0_8.domain.internal]

COVERAGE SUMMARY FOR SOURCE FILE [OrgImpl.java]

nameclass, %method, %block, %line, %
OrgImpl.java100% (1/1)50%  (5/10)17%  (48/284)20%  (11/55)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OrgImpl100% (1/1)50%  (5/10)17%  (48/284)20%  (11/55)
compareTo (ReferenceType): int 0%   (0/1)0%   (0/11)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/103)0%   (0/33)
getDescription (): String 0%   (0/1)0%   (0/3)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)
OrgImpl (String, String, URI, String, Map, Map, Map, ReferenceType): void 100% (1/1)100% (36/36)100% (7/7)
getCatalogs (): Map 100% (1/1)100% (3/3)100% (1/1)
getKeys (): ReferenceType 100% (1/1)100% (3/3)100% (1/1)
getTasksLists (): Map 100% (1/1)100% (3/3)100% (1/1)
getVDCs (): Map 100% (1/1)100% (3/3)100% (1/1)

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

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