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

COVERAGE SUMMARY FOR SOURCE FILE [DirectoryEntry.java]

nameclass, %method, %block, %line, %
DirectoryEntry.java100% (1/1)62%  (5/8)64%  (110/173)62%  (25.5/41)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DirectoryEntry100% (1/1)62%  (5/8)64%  (110/173)62%  (25.5/41)
getObjectID (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getType (): FileType 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)64%  (44/69)52%  (12/23)
compareTo (DirectoryEntry): int 100% (1/1)75%  (12/16)60%  (1.8/3)
hashCode (): int 100% (1/1)87%  (39/45)95%  (5.7/6)
DirectoryEntry (String, FileType, String): void 100% (1/1)100% (12/12)100% (5/5)
getObjectName (): 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.atmos.domain;
20 
21/**
22 * Metadata of a Atmos Online object
23 * 
24 * @author Adrian Cole
25 */
26public class DirectoryEntry implements Comparable<DirectoryEntry> {
27   private final String objectid;
28   private final FileType type;
29   private final String objname;
30 
31   public DirectoryEntry(String objectid, FileType type, String objname) {
32      this.objectid = objectid;
33      this.objname = objname;
34      this.type = type;
35   }
36 
37   public String getObjectID() {
38      return objectid;
39   }
40 
41   public String getObjectName() {
42      return objname;
43   }
44 
45   public FileType getType() {
46      return type;
47   }
48 
49   public int compareTo(DirectoryEntry o) {
50      if (getObjectName() == null)
51         return -1;
52      return (this == o) ? 0 : getObjectName().compareTo(o.getObjectName());
53   }
54 
55   @Override
56   public int hashCode() {
57      final int prime = 31;
58      int result = 1;
59      result = prime * result + ((objectid == null) ? 0 : objectid.hashCode());
60      result = prime * result + ((objname == null) ? 0 : objname.hashCode());
61      result = prime * result + ((type == null) ? 0 : type.hashCode());
62      return result;
63   }
64 
65   @Override
66   public boolean equals(Object obj) {
67      if (this == obj)
68         return true;
69      if (obj == null)
70         return false;
71      if (getClass() != obj.getClass())
72         return false;
73      DirectoryEntry other = (DirectoryEntry) obj;
74      if (objectid == null) {
75         if (other.objectid != null)
76            return false;
77      } else if (!objectid.equals(other.objectid))
78         return false;
79      if (objname == null) {
80         if (other.objname != null)
81            return false;
82      } else if (!objname.equals(other.objname))
83         return false;
84      if (type == null) {
85         if (other.type != null)
86            return false;
87      } else if (!type.equals(other.type))
88         return false;
89      return true;
90   }
91 
92   @Override
93   public String toString() {
94      return "DirectoryEntry [type=" + type + ", objectid=" + objectid + ", objname=" + objname
95               + "]";
96   }
97}

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