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

COVERAGE SUMMARY FOR SOURCE FILE [HashSetListBlobsResponse.java]

nameclass, %method, %block, %line, %
HashSetListBlobsResponse.java100% (1/1)33%  (2/6)44%  (58/131)48%  (15/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HashSetListBlobsResponse100% (1/1)33%  (2/6)44%  (58/131)48%  (15/31)
getBlobPrefixes (): Set 0%   (0/1)0%   (0/3)0%   (0/1)
getDelimiter (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/33)0%   (0/5)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/1)
equals (Object): boolean 100% (1/1)69%  (38/55)56%  (10/18)
HashSetListBlobsResponse (Iterable, URI, String, String, Integer, String, Str... 100% (1/1)100% (20/20)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.azureblob.domain.internal;
20 
21import java.net.URI;
22import java.util.Set;
23 
24import org.jclouds.azureblob.domain.BlobProperties;
25import org.jclouds.azureblob.domain.ListBlobsResponse;
26import org.jclouds.azure.storage.domain.internal.BoundedHashSet;
27 
28import com.google.common.collect.Iterables;
29import com.google.common.collect.Sets;
30 
31/**
32 * 
33 * @author Adrian Cole
34 * 
35 */
36public class HashSetListBlobsResponse extends BoundedHashSet<BlobProperties> implements
37         ListBlobsResponse {
38   /** The serialVersionUID */
39   private static final long serialVersionUID = -4475709781001190244L;
40 
41   protected final String delimiter;
42   protected final Set<String> blobPrefixes = Sets.newHashSet();
43 
44   public HashSetListBlobsResponse(Iterable<BlobProperties> contents, URI url, String prefix,
45            String marker, Integer maxResults, String nextMarker, String delimiter,
46            Iterable<String> blobPrefixes) {
47      super(contents, url, prefix, marker, maxResults, nextMarker);
48      this.delimiter = delimiter;
49      Iterables.addAll(this.blobPrefixes, blobPrefixes);
50   }
51 
52   public String getDelimiter() {
53      return delimiter;
54   }
55 
56   public Set<String> getBlobPrefixes() {
57      return blobPrefixes;
58   }
59 
60   @Override
61   public int hashCode() {
62      final int prime = 31;
63      int result = super.hashCode();
64      result = prime * result + ((blobPrefixes == null) ? 0 : blobPrefixes.hashCode());
65      result = prime * result + ((delimiter == null) ? 0 : delimiter.hashCode());
66      return result;
67   }
68 
69   @Override
70   public boolean equals(Object obj) {
71      if (this == obj)
72         return true;
73      if (!super.equals(obj))
74         return false;
75      if (getClass() != obj.getClass())
76         return false;
77      HashSetListBlobsResponse other = (HashSetListBlobsResponse) obj;
78      if (blobPrefixes == null) {
79         if (other.blobPrefixes != null)
80            return false;
81      } else if (!blobPrefixes.equals(other.blobPrefixes))
82         return false;
83      if (delimiter == null) {
84         if (other.delimiter != null)
85            return false;
86      } else if (!delimiter.equals(other.delimiter))
87         return false;
88      return true;
89   }
90 
91   @Override
92   public String toString() {
93      return "[blobPrefixes=" + blobPrefixes + ", delimiter=" + delimiter
94               + "]";
95   }
96}

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