EMMA Coverage Report (generated Wed Jun 22 19:47:49 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 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
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