EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.internal]

COVERAGE SUMMARY FOR SOURCE FILE [ClassMethodArgs.java]

nameclass, %method, %block, %line, %
ClassMethodArgs.java100% (1/1)86%  (6/7)58%  (88/153)42%  (14.8/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ClassMethodArgs100% (1/1)86%  (6/7)58%  (88/153)42%  (14.8/35)
equals (Object): boolean 0%   (0/1)0%   (0/61)0%   (0/20)
hashCode (): int 100% (1/1)90%  (36/40)97%  (5.8/6)
ClassMethodArgs (Class, Method, Object []): void 100% (1/1)100% (18/18)100% (5/5)
getArgs (): Object [] 100% (1/1)100% (3/3)100% (1/1)
getAsyncClass (): Class 100% (1/1)100% (3/3)100% (1/1)
getMethod (): Method 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (25/25)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.internal;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.lang.reflect.Method;
24import java.util.Arrays;
25 
26import org.jclouds.javax.annotation.Nullable;
27 
28/**
29 * 
30 * @author Adrian Cole
31 */
32public class ClassMethodArgs {
33   private final Method method;
34   private final Object[] args;
35   private final Class<?> asyncClass;
36 
37   public ClassMethodArgs(Class<?> asyncClass, Method method, @Nullable Object[] args) {
38      this.asyncClass = checkNotNull(asyncClass, "asyncClass");
39      this.method = checkNotNull(method, "method");
40      this.args = args;
41   }
42 
43   @Override
44   public String toString() {
45      return "[class=" + asyncClass.getSimpleName() + ", method=" + method.getName() + ", args="
46            + Arrays.toString(args) + "]";
47   }
48 
49   public Method getMethod() {
50      return method;
51   }
52 
53   public Object[] getArgs() {
54      return args;
55   }
56 
57   @Override
58   public int hashCode() {
59      final int prime = 31;
60      int result = 1;
61      result = prime * result + Arrays.hashCode(args);
62      result = prime * result + ((asyncClass == null) ? 0 : asyncClass.hashCode());
63      result = prime * result + ((method == null) ? 0 : method.hashCode());
64      return result;
65   }
66 
67   @Override
68   public boolean equals(Object obj) {
69      if (this == obj)
70         return true;
71      if (obj == null)
72         return false;
73      if (getClass() != obj.getClass())
74         return false;
75      ClassMethodArgs other = (ClassMethodArgs) obj;
76      if (!Arrays.equals(args, other.args))
77         return false;
78      if (asyncClass == null) {
79         if (other.asyncClass != null)
80            return false;
81      } else if (!asyncClass.equals(other.asyncClass))
82         return false;
83      if (method == null) {
84         if (other.method != null)
85            return false;
86      } else if (!method.equals(other.method))
87         return false;
88      return true;
89   }
90 
91   public Class<?> getAsyncClass() {
92      return asyncClass;
93   }
94}

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