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

COVERAGE SUMMARY FOR SOURCE FILE [ClassMethodArgs.java]

nameclass, %method, %block, %line, %
ClassMethodArgs.java100% (1/1)100% (7/7)61%  (93/153)48%  (16.8/35)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ClassMethodArgs100% (1/1)100% (7/7)61%  (93/153)48%  (16.8/35)
equals (Object): boolean 100% (1/1)8%   (5/61)10%  (2/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 *
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.internal;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.lang.reflect.Method;
24import java.util.Arrays;
25 
26import 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