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

COVERAGE SUMMARY FOR SOURCE FILE [Option.java]

nameclass, %method, %block, %line, %
Option.java100% (1/1)55%  (6/11)58%  (98/168)67%  (18/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Option100% (1/1)55%  (6/11)58%  (98/168)67%  (18/27)
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)
toString (): String 0%   (0/1)0%   (0/22)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 * 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;
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 
92   @Override
93   public String toString() {
94      return "[id=" + id + ", name=" + name + ", description=" + description + "]";
95   }
96}

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