EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.gogrid.domain]

COVERAGE SUMMARY FOR SOURCE FILE [BillingToken.java]

nameclass, %method, %block, %line, %
BillingToken.java100% (1/1)56%  (5/9)47%  (65/138)58%  (14/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BillingToken100% (1/1)56%  (5/9)47%  (65/138)58%  (14/24)
equals (Object): boolean 0%   (0/1)0%   (0/43)0%   (0/7)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getPrice (): double 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/24)0%   (0/1)
BillingToken (): void 100% (1/1)100% (3/3)100% (2/2)
BillingToken (long, String, double): void 100% (1/1)100% (12/12)100% (5/5)
compareTo (BillingToken): int 100% (1/1)100% (6/6)100% (1/1)
getId (): long 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (41/41)100% (5/5)

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 BillingToken implements Comparable<BillingToken> {
27 
28    private long id;
29    private String name;
30    private double price;
31 
32    /**
33     * A no-args constructor is required for deserialization
34     */
35    public BillingToken() {
36    }
37 
38    public BillingToken(long id, String name, double price) {
39        this.id = id;
40        this.name = name;
41        this.price = price;
42    }
43 
44    public long getId() {
45        return id;
46    }
47 
48    public String getName() {
49        return name;
50    }
51 
52    public double getPrice() {
53        return price;
54    }
55 
56    @Override
57    public boolean equals(Object o) {
58        if (this == o) return true;
59        if (o == null || getClass() != o.getClass()) return false;
60 
61        BillingToken that = (BillingToken) o;
62 
63        if (id != that.id) return false;
64        if (Double.compare(that.price, price) != 0) return false;
65        if (!name.equals(that.name)) return false;
66 
67        return true;
68    }
69 
70    @Override
71    public int hashCode() {
72        int result;
73        long temp;
74        result = (int) (id ^ (id >>> 32));
75        result = 31 * result + name.hashCode();
76        temp = price != +0.0d ? Double.doubleToLongBits(price) : 0L;
77        result = 31 * result + (int) (temp ^ (temp >>> 32));
78        return result;
79    }
80 
81    @Override
82    public int compareTo(BillingToken o) {
83        return Longs.compare(id, o.getId());
84    }
85 
86    @Override
87    public String toString() {
88        return "BillingToken{" +
89                "id=" + id +
90                ", name='" + name + '\'' +
91                ", price=" + price +
92                '}';
93    }
94}

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