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

COVERAGE SUMMARY FOR SOURCE FILE [ContainerMetadata.java]

nameclass, %method, %block, %line, %
ContainerMetadata.java100% (1/1)64%  (7/11)71%  (106/150)67%  (28/42)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ContainerMetadata100% (1/1)64%  (7/11)71%  (106/150)67%  (28/42)
compareTo (ContainerMetadata): int 0%   (0/1)0%   (0/16)0%   (0/3)
getBytes (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getCount (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)68%  (36/53)53%  (9/17)
hashCode (): int 100% (1/1)96%  (43/45)99%  (6/6)
ContainerMetadata (): void 100% (1/1)100% (3/3)100% (2/2)
ContainerMetadata (String, long, long): void 100% (1/1)100% (12/12)100% (5/5)
setBytes (long): void 100% (1/1)100% (4/4)100% (2/2)
setCount (long): void 100% (1/1)100% (4/4)100% (2/2)
setName (String): void 100% (1/1)100% (4/4)100% (2/2)

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.openstack.swift.domain;
20 
21 
22/**
23 * 
24 * @author Adrian Cole
25 * 
26 */
27public class ContainerMetadata implements Comparable<ContainerMetadata> {
28   private String name;
29   private long count;
30   private long bytes;
31 
32   public ContainerMetadata() {
33   }
34 
35   public ContainerMetadata(String name, long count, long bytes) {
36      setName(name);
37      setBytes(bytes);
38      setCount(count);
39   }
40 
41   public long getCount() {
42      return count;
43   }
44 
45   public void setCount(long count) {
46      this.count = count;
47   }
48 
49   public void setName(String name) {
50      this.name = name;
51   }
52 
53   public String getName() {
54      return name;
55   }
56 
57   public void setBytes(long bytes) {
58      this.bytes = bytes;
59   }
60 
61   public long getBytes() {
62      return bytes;
63   }
64 
65   @Override
66   public int hashCode() {
67      final int prime = 31;
68      int result = 1;
69      result = prime * result + (int) (bytes ^ (bytes >>> 32));
70      result = prime * result + (int) (count ^ (count >>> 32));
71      result = prime * result + ((name == null) ? 0 : name.hashCode());
72      return result;
73   }
74 
75   @Override
76   public boolean equals(Object obj) {
77      if (this == obj)
78         return true;
79      if (obj == null)
80         return false;
81      if (getClass() != obj.getClass())
82         return false;
83      ContainerMetadata other = (ContainerMetadata) obj;
84      if (bytes != other.bytes)
85         return false;
86      if (count != other.count)
87         return false;
88      if (name == null) {
89         if (other.name != null)
90            return false;
91      } else if (!name.equals(other.name))
92         return false;
93      return true;
94   }
95 
96   public int compareTo(ContainerMetadata o) {
97      if (getName() == null)
98         return -1;
99      return (this == o) ? 0 : getName().compareTo(o.getName());
100   }
101 
102}

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