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

COVERAGE SUMMARY FOR SOURCE FILE [KeyAuthentication.java]

nameclass, %method, %block, %line, %
KeyAuthentication.java100% (1/1)40%  (2/5)24%  (19/78)18%  (4/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class KeyAuthentication100% (1/1)40%  (2/5)24%  (19/78)18%  (4/22)
equals (Object): boolean 0%   (0/1)0%   (0/37)0%   (0/13)
getKeyName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/19)0%   (0/4)
KeyAuthentication (String): void 100% (1/1)100% (9/9)100% (3/3)
toString (): String 100% (1/1)100% (10/10)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.deltacloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.io.Serializable;
24 
25/**
26 * 
27 * @author Adrian Cole
28 */
29public class KeyAuthentication implements Instance.Authentication, Serializable {
30 
31   /** The serialVersionUID */
32   private static final long serialVersionUID = 7669076186483470376L;
33   private final String keyName;
34 
35   public KeyAuthentication(String keyName) {
36      this.keyName = checkNotNull(keyName, "keyName");
37   }
38 
39   public String getKeyName() {
40      return keyName;
41   }
42 
43   @Override
44   public int hashCode() {
45      final int prime = 31;
46      int result = 1;
47      result = prime * result + ((keyName == null) ? 0 : keyName.hashCode());
48      return result;
49   }
50 
51   @Override
52   public boolean equals(Object obj) {
53      if (this == obj)
54         return true;
55      if (obj == null)
56         return false;
57      if (getClass() != obj.getClass())
58         return false;
59      KeyAuthentication other = (KeyAuthentication) obj;
60      if (keyName == null) {
61         if (other.keyName != null)
62            return false;
63      } else if (!keyName.equals(other.keyName))
64         return false;
65      return true;
66   }
67 
68   @Override
69   public String toString() {
70      return String.format("[keyName=%s]", keyName);
71   }
72 
73}

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