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

COVERAGE SUMMARY FOR SOURCE FILE [PageSetImpl.java]

nameclass, %method, %block, %line, %
PageSetImpl.java100% (1/1)50%  (2/4)18%  (13/72)23%  (5/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PageSetImpl100% (1/1)50%  (2/4)18%  (13/72)23%  (5/22)
equals (Object): boolean 0%   (0/1)0%   (0/39)0%   (0/13)
hashCode (): int 0%   (0/1)0%   (0/20)0%   (0/4)
PageSetImpl (Iterable, String): void 100% (1/1)100% (10/10)100% (4/4)
getNextMarker (): String 100% (1/1)100% (3/3)100% (1/1)

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.blobstore.domain.internal;
20 
21import java.util.LinkedHashSet;
22 
23import org.jclouds.javax.annotation.Nullable;
24 
25import org.jclouds.blobstore.domain.PageSet;
26 
27import com.google.common.collect.Iterables;
28 
29public class PageSetImpl<T> extends LinkedHashSet<T> implements PageSet<T> {
30 
31   /** The serialVersionUID */
32   private static final long serialVersionUID = -7133632087734650835L;
33   protected final String marker;
34 
35   public PageSetImpl(Iterable<? extends T> contents, @Nullable String nextMarker) {
36      Iterables.addAll(this, contents);
37      this.marker = nextMarker;
38   }
39 
40   /**
41    * {@inheritDoc}
42    */
43   @Override
44   public String getNextMarker() {
45      return marker;
46   }
47 
48   /**
49    * {@inheritDoc}
50    */
51   @Override
52   public int hashCode() {
53      final int prime = 31;
54      int result = super.hashCode();
55      result = prime * result + ((marker == null) ? 0 : marker.hashCode());
56      return result;
57   }
58 
59   /**
60    * {@inheritDoc}
61    */
62   @Override
63   public boolean equals(Object obj) {
64      if (this == obj)
65         return true;
66      if (!super.equals(obj))
67         return false;
68      if (getClass() != obj.getClass())
69         return false;
70      PageSetImpl<?> other = (PageSetImpl<?>) obj;
71      if (marker == null) {
72         if (other.marker != null)
73            return false;
74      } else if (!marker.equals(other.marker))
75         return false;
76      return true;
77   }
78 
79}

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