EMMA Coverage Report (generated Fri Apr 27 15:03:37 EDT 2012)
[all classes][org.jclouds.ec2.domain]

COVERAGE SUMMARY FOR SOURCE FILE [BlockDevice.java]

nameclass, %method, %block, %line, %
BlockDevice.java100% (1/1)78%  (7/9)78%  (151/193)66%  (29.6/45)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BlockDevice100% (1/1)78%  (7/9)78%  (151/193)66%  (29.6/45)
getAttachTime (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
getAttachmentStatus (): Attachment$Status 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)62%  (47/76)48%  (12/25)
hashCode (): int 100% (1/1)88%  (49/56)95%  (6.6/7)
BlockDevice (String, Attachment$Status, Date, boolean): void 100% (1/1)100% (15/15)100% (6/6)
BlockDevice (String, boolean): void 100% (1/1)100% (7/7)100% (2/2)
getVolumeId (): String 100% (1/1)100% (3/3)100% (1/1)
isDeleteOnTermination (): boolean 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (27/27)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.ec2.domain;
20 
21import java.util.Date;
22 
23import org.jclouds.ec2.domain.Attachment.Status;
24 
25/**
26 * 
27 * @see <a href=
28 *      "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-ItemType-RunningInstancesItemType.html"
29 *      />
30 * @author Adrian Cole
31 */
32public class BlockDevice {
33   private final String volumeId;
34   private final Attachment.Status attachmentStatus;
35   private final Date attachTime;
36   private final boolean deleteOnTermination;
37 
38   public BlockDevice(String volumeId, Status attachmentStatus, Date attachTime, boolean deleteOnTermination) {
39      this.volumeId = volumeId;
40      this.attachmentStatus = attachmentStatus;
41      this.attachTime = attachTime;
42      this.deleteOnTermination = deleteOnTermination;
43   }
44 
45   public BlockDevice(String volumeId, boolean deleteOnTermination) {
46      this(volumeId, null, null, deleteOnTermination);
47   }
48 
49   @Override
50   public int hashCode() {
51      final int prime = 31;
52      int result = 1;
53      result = prime * result + ((attachTime == null) ? 0 : attachTime.hashCode());
54      result = prime * result + ((attachmentStatus == null) ? 0 : attachmentStatus.hashCode());
55      result = prime * result + (deleteOnTermination ? 1231 : 1237);
56      result = prime * result + ((volumeId == null) ? 0 : volumeId.hashCode());
57      return result;
58   }
59 
60   @Override
61   public boolean equals(Object obj) {
62      if (this == obj)
63         return true;
64      if (obj == null)
65         return false;
66      if (getClass() != obj.getClass())
67         return false;
68      BlockDevice other = (BlockDevice) obj;
69      if (attachTime == null) {
70         if (other.attachTime != null)
71            return false;
72      } else if (!attachTime.equals(other.attachTime))
73         return false;
74      if (attachmentStatus == null) {
75         if (other.attachmentStatus != null)
76            return false;
77      } else if (!attachmentStatus.equals(other.attachmentStatus))
78         return false;
79      if (deleteOnTermination != other.deleteOnTermination)
80         return false;
81      if (volumeId == null) {
82         if (other.volumeId != null)
83            return false;
84      } else if (!volumeId.equals(other.volumeId))
85         return false;
86      return true;
87   }
88 
89   public String getVolumeId() {
90      return volumeId;
91   }
92 
93   public Attachment.Status getAttachmentStatus() {
94      return attachmentStatus;
95   }
96 
97   public Date getAttachTime() {
98      return attachTime;
99   }
100 
101   public boolean isDeleteOnTermination() {
102      return deleteOnTermination;
103   }
104 
105   @Override
106   public String toString() {
107      return "[volumeId=" + volumeId + ", attachmentStatus=" + attachmentStatus + ", attachTime="
108            + attachTime + ", deleteOnTermination=" + deleteOnTermination + "]";
109   }
110 
111}

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