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

COVERAGE SUMMARY FOR SOURCE FILE [StorageMetadataImpl.java]

nameclass, %method, %block, %line, %
StorageMetadataImpl.java100% (1/1)33%  (2/6)17%  (23/137)18%  (6/34)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StorageMetadataImpl100% (1/1)33%  (2/6)17%  (23/137)18%  (6/34)
equals (Object): boolean 0%   (0/1)0%   (0/62)0%   (0/20)
getETag (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getLastModified (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/46)0%   (0/6)
StorageMetadataImpl (StorageType, String, String, Location, URI, String, Date... 100% (1/1)100% (20/20)100% (5/5)
getType (): StorageType 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 static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.io.Serializable;
24import java.net.URI;
25import java.util.Date;
26import java.util.Map;
27 
28import org.jclouds.javax.annotation.Nullable;
29 
30import org.jclouds.blobstore.domain.StorageMetadata;
31import org.jclouds.blobstore.domain.StorageType;
32import org.jclouds.domain.Location;
33import org.jclouds.domain.internal.ResourceMetadataImpl;
34 
35/**
36 * Idpayload of the object
37 * 
38 * @author Adrian Cole
39 */
40public class StorageMetadataImpl extends ResourceMetadataImpl<StorageType> implements StorageMetadata, Serializable {
41 
42   /** The serialVersionUID */
43   private static final long serialVersionUID = -280558162576368264L;
44 
45   @Nullable
46   private final String eTag;
47   @Nullable
48   private final Date lastModified;
49   private final StorageType type;
50 
51   public StorageMetadataImpl(StorageType type, @Nullable String id, @Nullable String name,
52         @Nullable Location location, @Nullable URI uri, @Nullable String eTag, @Nullable Date lastModified,
53         Map<String, String> userMetadata) {
54      super(id, name, location, uri, userMetadata);
55      this.eTag = eTag;
56      this.lastModified = lastModified;
57      this.type = checkNotNull(type, "type");
58   }
59 
60   /**
61    * {@inheritDoc}
62    */
63   @Override
64   public StorageType getType() {
65      return type;
66   }
67 
68   @Override
69   public int hashCode() {
70      final int prime = 31;
71      int result = super.hashCode();
72      result = prime * result + ((eTag == null) ? 0 : eTag.hashCode());
73      result = prime * result + ((lastModified == null) ? 0 : lastModified.hashCode());
74      result = prime * result + ((type == null) ? 0 : type.hashCode());
75      return result;
76   }
77 
78   @Override
79   public boolean equals(Object obj) {
80      if (this == obj)
81         return true;
82      if (!super.equals(obj))
83         return false;
84      if (getClass() != obj.getClass())
85         return false;
86      StorageMetadataImpl other = (StorageMetadataImpl) obj;
87      if (eTag == null) {
88         if (other.eTag != null)
89            return false;
90      } else if (!eTag.equals(other.eTag))
91         return false;
92      if (lastModified == null) {
93         if (other.lastModified != null)
94            return false;
95      } else if (!lastModified.equals(other.lastModified))
96         return false;
97      if (type != other.type)
98         return false;
99      return true;
100   }
101 
102   /**
103    * {@inheritDoc}
104    */
105   @Override
106   public String getETag() {
107      return eTag;
108   }
109 
110   /**
111    * {@inheritDoc}
112    */
113   @Override
114   public Date getLastModified() {
115      return lastModified;
116   }
117 
118}

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