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

COVERAGE SUMMARY FOR SOURCE FILE [BlockDevice.java]

nameclass, %method, %block, %line, %
BlockDevice.java0%   (0/2)0%   (0/8)0%   (0/111)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BlockDevice0%   (0/1)0%   (0/6)0%   (0/95)0%   (0/21)
BlockDevice (String, MediaType, int): void 0%   (0/1)0%   (0/18)0%   (0/4)
equals (Object): boolean 0%   (0/1)0%   (0/28)0%   (0/10)
getId (): String 0%   (0/1)0%   (0/11)0%   (0/1)
getIndex (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/13)0%   (0/4)
toString (): String 0%   (0/1)0%   (0/22)0%   (0/1)
     
class BlockDevice$Builder0%   (0/1)0%   (0/2)0%   (0/16)0%   (0/4)
BlockDevice$Builder (int): void 0%   (0/1)0%   (0/6)0%   (0/3)
build (): Device 0%   (0/1)0%   (0/10)0%   (0/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.cloudsigma.domain;
20 
21import static com.google.common.base.Preconditions.checkArgument;
22 
23/**
24 * 
25 * @author Adrian Cole
26 */
27public class BlockDevice extends Device {
28   public static class Builder extends Device.Builder {
29      private final int index;
30 
31      public Builder(int index) {
32         this.index = index;
33      }
34 
35      @Override
36      public Device build() {
37         return new BlockDevice(uuid, mediaType, index);
38      }
39 
40   }
41 
42   private final int index;
43 
44   public BlockDevice(String driveUuid, MediaType mediaType, int index) {
45      super(driveUuid, mediaType);
46      checkArgument(index >= 0 && index < 8, "index must be between 0 and 7");
47      this.index = index;
48   }
49 
50   @Override
51   public int hashCode() {
52      final int prime = 31;
53      int result = 1;
54      result = prime * result + index;
55      return result;
56   }
57 
58   @Override
59   public boolean equals(Object obj) {
60      if (this == obj)
61         return true;
62      if (obj == null)
63         return false;
64      if (getClass() != obj.getClass())
65         return false;
66      BlockDevice other = (BlockDevice) obj;
67      if (index != other.index)
68         return false;
69      return true;
70   }
71 
72   @Override
73   public String getId() {
74      return String.format("block:%d", index);
75   }
76 
77   public int getIndex() {
78      return index;
79   }
80 
81   @Override
82   public String toString() {
83      return "[id=" + getId() + ", driveUuid=" + driveUuid + ", mediaType=" + mediaType + "]";
84   }
85}

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