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

COVERAGE SUMMARY FOR SOURCE FILE [PasswordAuthentication.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

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