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

COVERAGE SUMMARY FOR SOURCE FILE [CopyObjectResult.java]

nameclass, %method, %block, %line, %
CopyObjectResult.java100% (1/1)27%  (4/15)38%  (59/154)40%  (16/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CopyObjectResult100% (1/1)27%  (4/15)38%  (59/154)40%  (16/40)
compareTo (ObjectMetadata): int 0%   (0/1)0%   (0/11)0%   (0/1)
getBucket (): String 0%   (0/1)0%   (0/2)0%   (0/1)
getCacheControl (): String 0%   (0/1)0%   (0/2)0%   (0/1)
getContentMetadata (): ContentMetadata 0%   (0/1)0%   (0/3)0%   (0/1)
getKey (): String 0%   (0/1)0%   (0/2)0%   (0/1)
getOwner (): CanonicalUser 0%   (0/1)0%   (0/2)0%   (0/1)
getStorageClass (): ObjectMetadata$StorageClass 0%   (0/1)0%   (0/2)0%   (0/1)
getUri (): URI 0%   (0/1)0%   (0/2)0%   (0/1)
getUserMetadata (): Map 0%   (0/1)0%   (0/2)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/32)0%   (0/5)
toString (): String 0%   (0/1)0%   (0/15)0%   (0/1)
equals (Object): boolean 100% (1/1)62%  (33/53)50%  (9/18)
CopyObjectResult (Date, String): void 100% (1/1)100% (20/20)100% (5/5)
getETag (): String 100% (1/1)100% (3/3)100% (1/1)
getLastModified (): Date 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.s3.domain.internal;
20 
21import java.io.Serializable;
22import java.net.URI;
23import java.util.Date;
24import java.util.Map;
25 
26import org.jclouds.io.ContentMetadata;
27import org.jclouds.io.payloads.BaseImmutableContentMetadata;
28import org.jclouds.s3.domain.CanonicalUser;
29import org.jclouds.s3.domain.ObjectMetadata;
30 
31import com.google.common.collect.ImmutableMap;
32 
33/**
34 * Returns the metadata parsable from a bucket listing
35 * 
36 * @author Adrian Cole
37 */
38public class CopyObjectResult implements Serializable, ObjectMetadata {
39 
40   /** The serialVersionUID */
41   private static final long serialVersionUID = -4415449798024051115L;
42 
43   private final Date lastModified;
44   private final String eTag;
45   private final BaseImmutableContentMetadata contentMetadata;
46 
47   public CopyObjectResult(Date lastModified, String eTag) {
48      this.lastModified = lastModified;
49      this.eTag = eTag;
50      this.contentMetadata = new BaseImmutableContentMetadata(null, null, null, null, null, null);
51   }
52 
53   /**
54    *{@inheritDoc}
55    */
56   @Override
57   public String getKey() {
58      return null;
59   }
60 
61   /**
62    *{@inheritDoc}
63    */
64   @Override
65   public String getBucket() {
66      return null;
67   }
68 
69   /**
70    *{@inheritDoc}
71    */
72   @Override
73   public URI getUri() {
74      return null;
75   }
76 
77   /**
78    *{@inheritDoc}
79    */
80   @Override
81   public CanonicalUser getOwner() {
82      return null;
83   }
84 
85   /**
86    *{@inheritDoc}
87    */
88   @Override
89   public StorageClass getStorageClass() {
90      return null;
91   }
92 
93   /**
94    *{@inheritDoc}
95    */
96   @Override
97   public String getCacheControl() {
98      return null;
99   }
100 
101   /**
102    *{@inheritDoc}
103    */
104   @Override
105   public Date getLastModified() {
106      return lastModified;
107   }
108 
109   /**
110    *{@inheritDoc}
111    */
112   @Override
113   public String getETag() {
114      return eTag;
115   }
116 
117   /**
118    *{@inheritDoc}
119    */
120   @Override
121   public int compareTo(ObjectMetadata o) {
122      return (this == o) ? 0 : getETag().compareTo(o.getETag());
123   }
124 
125   /**
126    *{@inheritDoc}
127    */
128   @Override
129   public Map<String, String> getUserMetadata() {
130      return ImmutableMap.of();
131   }
132 
133   /**
134    *{@inheritDoc}
135    */
136   @Override
137   public ContentMetadata getContentMetadata() {
138      return contentMetadata;
139   }
140 
141   @Override
142   public int hashCode() {
143      final int prime = 31;
144      int result = 1;
145      result = prime * result + ((eTag == null) ? 0 : eTag.hashCode());
146      result = prime * result + ((lastModified == null) ? 0 : lastModified.hashCode());
147      return result;
148   }
149 
150   @Override
151   public boolean equals(Object obj) {
152      if (this == obj)
153         return true;
154      if (obj == null)
155         return false;
156      if (getClass() != obj.getClass())
157         return false;
158      CopyObjectResult other = (CopyObjectResult) obj;
159      if (eTag == null) {
160         if (other.eTag != null)
161            return false;
162      } else if (!eTag.equals(other.eTag))
163         return false;
164      if (lastModified == null) {
165         if (other.lastModified != null)
166            return false;
167      } else if (!lastModified.equals(other.lastModified))
168         return false;
169      return true;
170   }
171 
172   @Override
173   public String toString() {
174      return String.format("[eTag=%s, lastModified=%s]", eTag, lastModified);
175   }
176 
177}

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