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

COVERAGE SUMMARY FOR SOURCE FILE [DeltacloudCollection.java]

nameclass, %method, %block, %line, %
DeltacloudCollection.java100% (1/1)50%  (4/8)64%  (111/173)62%  (24.7/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeltacloudCollection100% (1/1)50%  (4/8)64%  (111/173)62%  (24.7/40)
getFeatures (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getHref (): URI 0%   (0/1)0%   (0/3)0%   (0/1)
getRel (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/22)0%   (0/1)
equals (Object): boolean 100% (1/1)64%  (44/69)52%  (12/23)
hashCode (): int 100% (1/1)87%  (39/45)95%  (5.7/6)
DeltacloudCollection (URI, String): void 100% (1/1)100% (6/6)100% (2/2)
DeltacloudCollection (URI, String, Set): void 100% (1/1)100% (22/22)100% (5/5)

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.deltacloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.net.URI;
24import java.util.Set;
25 
26import com.google.common.collect.ImmutableSet;
27 
28/**
29 * 
30 * @author Adrian Cole
31 */
32public class DeltacloudCollection {
33   private final URI href;
34   private final String rel;
35   private final Set<? extends Feature> features;
36 
37   public DeltacloudCollection(URI href, String rel) {
38      this(href, rel, ImmutableSet.<Feature> of());
39   }
40 
41   public DeltacloudCollection(URI href, String rel, Set<? extends Feature> features) {
42      this.href = checkNotNull(href, "href");
43      this.rel = checkNotNull(rel, "rel");
44      this.features = ImmutableSet.copyOf(checkNotNull(features, "features"));
45   }
46 
47   public URI getHref() {
48      return href;
49   }
50 
51   public String getRel() {
52      return rel;
53   }
54 
55   public Set<? extends Feature> getFeatures() {
56      return features;
57   }
58 
59   @Override
60   public int hashCode() {
61      final int prime = 31;
62      int result = 1;
63      result = prime * result + ((features == null) ? 0 : features.hashCode());
64      result = prime * result + ((href == null) ? 0 : href.hashCode());
65      result = prime * result + ((rel == null) ? 0 : rel.hashCode());
66      return result;
67   }
68 
69   @Override
70   public boolean equals(Object obj) {
71      if (this == obj)
72         return true;
73      if (obj == null)
74         return false;
75      if (getClass() != obj.getClass())
76         return false;
77      DeltacloudCollection other = (DeltacloudCollection) obj;
78      if (features == null) {
79         if (other.features != null)
80            return false;
81      } else if (!features.equals(other.features))
82         return false;
83      if (href == null) {
84         if (other.href != null)
85            return false;
86      } else if (!href.equals(other.href))
87         return false;
88      if (rel == null) {
89         if (other.rel != null)
90            return false;
91      } else if (!rel.equals(other.rel))
92         return false;
93      return true;
94   }
95 
96   @Override
97   public String toString() {
98      return "[href=" + href + ", rel=" + rel + ", features=" + features + "]";
99   }
100}

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