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

COVERAGE SUMMARY FOR SOURCE FILE [JobProperties.java]

nameclass, %method, %block, %line, %
JobProperties.java100% (1/1)60%  (6/10)62%  (116/187)76%  (20.4/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class JobProperties100% (1/1)60%  (6/10)62%  (116/187)76%  (20.4/27)
getNote (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getState (): JobState 0%   (0/1)0%   (0/3)0%   (0/1)
getUpdatedOn (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/29)0%   (0/1)
equals (Object): boolean 100% (1/1)62%  (45/72)72%  (5.8/8)
hashCode (): int 100% (1/1)88%  (44/50)93%  (4.7/5)
JobProperties (): void 100% (1/1)100% (3/3)100% (2/2)
JobProperties (long, Date, JobState, String): void 100% (1/1)100% (15/15)100% (6/6)
compareTo (JobProperties): int 100% (1/1)100% (6/6)100% (1/1)
getId (): long 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.gogrid.domain;
20 
21import com.google.common.primitives.Longs;
22import com.google.gson.annotations.SerializedName;
23 
24import java.util.Date;
25 
26/**
27 * State of a job.
28 *
29 * @see <a href="http://wiki.gogrid.com/wiki/index.php/API:Job_State_(Object)"/>
30 *
31 * @author Oleksiy Yarmula
32 */
33public class JobProperties implements Comparable<JobProperties> {
34 
35    private long id;
36    @SerializedName("updatedon")
37    private Date updatedOn;
38    private JobState state;
39    private String note;
40 
41    /**
42     * A no-args constructor is required for deserialization
43     */
44    public JobProperties() {
45 
46    }
47 
48    public JobProperties(long id, Date updatedOn, JobState state, String note) {
49        this.id = id;
50        this.updatedOn = updatedOn;
51        this.state = state;
52        this.note = note;
53    }
54 
55    public long getId() {
56        return id;
57    }
58 
59    public Date getUpdatedOn() {
60        return updatedOn;
61    }
62 
63    public JobState getState() {
64        return state;
65    }
66 
67    public String getNote() {
68        return note;
69    }
70 
71    @Override
72    public boolean equals(Object o) {
73        if (this == o) return true;
74        if (o == null || getClass() != o.getClass()) return false;
75 
76        JobProperties jobState = (JobProperties) o;
77 
78        if (id != jobState.id) return false;
79        if (note != null ? !note.equals(jobState.note) : jobState.note != null) return false;
80        if (state != null ? !state.equals(jobState.state) : jobState.state != null) return false;
81        if (updatedOn != null ? !updatedOn.equals(jobState.updatedOn) : jobState.updatedOn != null) return false;
82 
83        return true;
84    }
85 
86    @Override
87    public int hashCode() {
88        int result = (int) (id ^ (id >>> 32));
89        result = 31 * result + (updatedOn != null ? updatedOn.hashCode() : 0);
90        result = 31 * result + (state != null ? state.hashCode() : 0);
91        result = 31 * result + (note != null ? note.hashCode() : 0);
92        return result;
93    }
94 
95    @Override
96    public String toString() {
97        return "JobState{" +
98                "id=" + id +
99                ", updatedOn=" + updatedOn +
100                ", state=" + state +
101                ", note='" + note + '\'' +
102                '}';
103    }
104 
105    @Override
106    public int compareTo(JobProperties o) {
107        return Longs.compare(id, o.getId());
108    }
109}

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