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

COVERAGE SUMMARY FOR SOURCE FILE [Image.java]

nameclass, %method, %block, %line, %
Image.java100% (1/1)83%  (5/6)69%  (70/102)74%  (19.9/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Image100% (1/1)83%  (5/6)69%  (70/102)74%  (19.9/27)
toString (): String 0%   (0/1)0%   (0/17)0%   (0/1)
equals (Object): boolean 100% (1/1)70%  (31/44)60%  (9/15)
hashCode (): int 100% (1/1)92%  (24/26)98%  (4.9/5)
Image (int, String): void 100% (1/1)100% (9/9)100% (4/4)
getId (): int 100% (1/1)100% (3/3)100% (1/1)
getName (): 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.slicehost.domain;
20 
21/**
22 * 
23 * 
24 * @author Adrian Cole
25 */
26public class Image {
27 
28   private final int id;
29   private final String name;
30 
31   public Image(int id, String name) {
32      this.id = id;
33      this.name = name;
34 
35   }
36 
37   /**
38    * @return id of the image
39    */
40   public int getId() {
41      return id;
42   }
43 
44   /**
45    * @return Example: Ubuntu 8.04 LTS (hardy)
46    */
47   public String getName() {
48      return name;
49   }
50 
51   @Override
52   public int hashCode() {
53      final int prime = 31;
54      int result = 1;
55      result = prime * result + id;
56      result = prime * result + ((name == null) ? 0 : name.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      Image other = (Image) obj;
69      if (id != other.id)
70         return false;
71      if (name == null) {
72         if (other.name != null)
73            return false;
74      } else if (!name.equals(other.name))
75         return false;
76 
77      return true;
78   }
79 
80   @Override
81   public String toString() {
82      return "[id=" + id + ", name=" + name + "]";
83   }
84 
85}

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