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

COVERAGE SUMMARY FOR SOURCE FILE [Image.java]

nameclass, %method, %block, %line, %
Image.java100% (1/1)63%  (12/19)56%  (99/178)49%  (24/49)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Image100% (1/1)63%  (12/19)56%  (99/178)49%  (24/49)
hashCode (): int 0%   (0/1)0%   (0/39)0%   (0/6)
setId (int): void 0%   (0/1)0%   (0/4)0%   (0/2)
setMetadata (Map): void 0%   (0/1)0%   (0/5)0%   (0/2)
setName (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setProgress (Integer): void 0%   (0/1)0%   (0/4)0%   (0/2)
setServerRef (String): void 0%   (0/1)0%   (0/4)0%   (0/2)
setStatus (ImageStatus): void 0%   (0/1)0%   (0/4)0%   (0/2)
equals (Object): boolean 100% (1/1)66%  (29/44)53%  (8/15)
Image (): void 100% (1/1)100% (6/6)100% (3/3)
Image (int, String): void 100% (1/1)100% (12/12)100% (5/5)
getCreated (): Date 100% (1/1)100% (3/3)100% (1/1)
getId (): int 100% (1/1)100% (3/3)100% (1/1)
getMetadata (): Map 100% (1/1)100% (4/4)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getProgress (): Integer 100% (1/1)100% (3/3)100% (1/1)
getServerRef (): String 100% (1/1)100% (3/3)100% (1/1)
getStatus (): ImageStatus 100% (1/1)100% (3/3)100% (1/1)
getUpdated (): Date 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.openstack.nova.domain;
20 
21import com.google.common.collect.Maps;
22 
23import java.util.Collections;
24import java.util.Date;
25import java.util.Map;
26 
27/**
28 * An image is a collection of files used to create or rebuild a server. Rackspace provides a number
29 * of pre-built OS images by default. You may also create custom images from cloud servers you have
30 * launched. These custom images are useful for backup purposes or for producing gold server images
31 * if you plan to deploy a particular server configuration frequently.
32 *
33 * @author Adrian Cole
34 */
35public class Image extends Resource {
36 
37   private int id;
38   private String name;
39   private Integer progress;
40   private String serverRef;
41   private ImageStatus status;
42   private Map<String, String> metadata = Maps.newHashMap();
43 
44   private Date created;
45   private Date updated;
46 
47   public Date getCreated() {
48      return created;
49   }
50 
51   public Date getUpdated() {
52      return updated;
53   }
54 
55 
56   public Image() {
57   }
58 
59   public Image(int id, String name) {
60      this.id = id;
61      this.name = name;
62   }
63 
64 
65   public void setId(int id) {
66      this.id = id;
67   }
68 
69   public int getId() {
70      return id;
71   }
72 
73   public void setName(String name) {
74      this.name = name;
75   }
76 
77   public String getName() {
78      return name;
79   }
80 
81   public void setProgress(Integer progress) {
82      this.progress = progress;
83   }
84 
85   public Integer getProgress() {
86      return progress;
87   }
88 
89   public void setServerRef(String serverRef) {
90      this.serverRef = serverRef;
91   }
92 
93   public String getServerRef() {
94      return serverRef;
95   }
96 
97   public void setStatus(ImageStatus status) {
98      this.status = status;
99   }
100 
101   public ImageStatus getStatus() {
102      return status;
103   }
104 
105 
106   public Map<String, String> getMetadata() {
107      return Collections.unmodifiableMap(metadata);
108   }
109 
110   public void setMetadata(Map<String, String> metadata) {
111      this.metadata = Maps.newHashMap(metadata);
112   }
113 
114   /**
115    * note that this ignores some fields
116    */
117   @Override
118   public int hashCode() {
119      final int prime = 31;
120      int result = 1;
121      result = prime * result + id;
122      result = prime * result + ((name == null) ? 0 : name.hashCode());
123      result = prime * result + ((serverRef == null) ? 0 : serverRef.hashCode());
124      return result;
125   }
126 
127   /**
128    * note that this ignores some fields
129    */
130   @Override
131   public boolean equals(Object obj) {
132      if (this == obj)
133         return true;
134      if (obj == null)
135         return false;
136      if (getClass() != obj.getClass())
137         return false;
138      Image other = (Image) obj;
139      if (id != other.id)
140         return false;
141      if (name == null) {
142         if (other.name != null)
143            return false;
144      } else if (!name.equals(other.name))
145         return false;
146      return true;
147   }
148 
149   @Override
150   public String toString() {
151      return "Image [created=" + getCreated() + ", id=" + id + ", name=" + name + ", serverRef="
152            + serverRef + "]";
153   }
154 
155}

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