EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.slicehost.domain]

COVERAGE SUMMARY FOR SOURCE FILE [Backup.java]

nameclass, %method, %block, %line, %
Backup.java0%   (0/1)0%   (0/8)0%   (0/182)0%   (0/43)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Backup0%   (0/1)0%   (0/8)0%   (0/182)0%   (0/43)
Backup (int, String, String, Date): void 0%   (0/1)0%   (0/15)0%   (0/6)
equals (Object): boolean 0%   (0/1)0%   (0/76)0%   (0/25)
getDate (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
getId (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getSliceId (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/52)0%   (0/7)
toString (): String 0%   (0/1)0%   (0/27)0%   (0/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 
21import java.util.Date;
22 
23/**
24 * 
25 * 
26 * @author Adrian Cole
27 */
28public class Backup {
29 
30   private final int id;
31   private final String name;
32   private final String sliceId;
33   private final Date date;
34 
35   public Backup(int id, String name, String sliceId, Date date) {
36      this.id = id;
37      this.name = name;
38      this.sliceId = sliceId;
39      this.date = date;
40   }
41 
42   /**
43    * @return id of the backup
44    */
45   public int getId() {
46      return id;
47   }
48 
49   /**
50    * @return Examples: weekly, my snapshot
51    */
52   public String getName() {
53      return name;
54   }
55 
56   /**
57    * @return The Slice this backup was made from
58    */
59   public String getSliceId() {
60      return sliceId;
61   }
62 
63   /**
64    * @return The time the backup was taken
65    */
66   public Date getDate() {
67      return date;
68   }
69 
70   @Override
71   public int hashCode() {
72      final int prime = 31;
73      int result = 1;
74      result = prime * result + ((date == null) ? 0 : date.hashCode());
75      result = prime * result + id;
76      result = prime * result + ((name == null) ? 0 : name.hashCode());
77      result = prime * result + ((sliceId == null) ? 0 : sliceId.hashCode());
78      return result;
79   }
80 
81   @Override
82   public boolean equals(Object obj) {
83      if (this == obj)
84         return true;
85      if (obj == null)
86         return false;
87      if (getClass() != obj.getClass())
88         return false;
89      Backup other = (Backup) obj;
90      if (date == null) {
91         if (other.date != null)
92            return false;
93      } else if (!date.equals(other.date))
94         return false;
95      if (id != other.id)
96         return false;
97      if (name == null) {
98         if (other.name != null)
99            return false;
100      } else if (!name.equals(other.name))
101         return false;
102      if (sliceId == null) {
103         if (other.sliceId != null)
104            return false;
105      } else if (!sliceId.equals(other.sliceId))
106         return false;
107      return true;
108   }
109 
110   @Override
111   public String toString() {
112      return "[date=" + date + ", id=" + id + ", name=" + name + ", sliceId=" + sliceId + "]";
113   }
114 
115}

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