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

COVERAGE SUMMARY FOR SOURCE FILE [Option.java]

nameclass, %method, %block, %line, %
Option.java100% (1/1)60%  (6/10)67%  (98/146)69%  (18/26)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Option100% (1/1)60%  (6/10)67%  (98/146)69%  (18/26)
Option (Long): void 0%   (0/1)0%   (0/6)0%   (0/2)
Option (String): void 0%   (0/1)0%   (0/6)0%   (0/2)
compareTo (Option): int 0%   (0/1)0%   (0/8)0%   (0/1)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)66%  (42/64)75%  (5.2/7)
hashCode (): int 100% (1/1)92%  (34/37)96%  (3.8/4)
Option (): void 100% (1/1)100% (3/3)100% (2/2)
Option (Long, String, String): void 100% (1/1)100% (12/12)100% (5/5)
getId (): long 100% (1/1)100% (4/4)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.gogrid.domain;
20 
21import com.google.common.primitives.Longs;
22 
23/**
24 * @author Oleksiy Yarmula
25 */
26public class Option implements Comparable<Option> {
27 
28    private Long id;
29    private String name;
30    private String description;
31 
32 
33    /**
34     * A no-args constructor is required for deserialization
35     */
36    public Option() {
37    }
38 
39    public Option(Long id) {
40        this(id, null, null);
41    }
42 
43    public Option(String name) {
44        this(null, name, null);
45    }
46 
47    public Option(Long id, String name, String description) {
48        this.id = id;
49        this.name = name;
50        this.description = description;
51    }
52 
53    public long getId() {
54        return id;
55    }
56 
57    public String getName() {
58        return name;
59    }
60 
61    public String getDescription() {
62        return description;
63    }
64 
65    @Override
66    public boolean equals(Object o) {
67        if (this == o) return true;
68        if (o == null || getClass() != o.getClass()) return false;
69 
70        Option option = (Option) o;
71 
72        if (description != null ? !description.equals(option.description) : option.description != null) return false;
73        if (id != null ? !id.equals(option.id) : option.id != null) return false;
74        if (name != null ? !name.equals(option.name) : option.name != null) return false;
75 
76        return true;
77    }
78 
79    @Override
80    public int hashCode() {
81        int result = id != null ? id.hashCode() : 0;
82        result = 31 * result + (name != null ? name.hashCode() : 0);
83        result = 31 * result + (description != null ? description.hashCode() : 0);
84        return result;
85    }
86 
87    @Override
88    public int compareTo(Option o) {
89        return Longs.compare(id, o.id);
90    }
91}

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