org.assertj.core.util.introspection
Class MethodSupport

java.lang.Object
  extended by org.assertj.core.util.introspection.MethodSupport

public class MethodSupport
extends Object

Utillity class for reflective method invocation.

Author:
MichaƂ Piotrkowski

Constructor Summary
MethodSupport()
           
 
Method Summary
static Object methodResultFor(Object instance, String methodName)
          Returns result of given method invocation on provided object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodSupport

public MethodSupport()
Method Detail

methodResultFor

public static Object methodResultFor(Object instance,
                                     String methodName)
Returns result of given method invocation on provided object.

Following requirements have to be met to extract method results:

Parameters:
instance - object on which
methodName - name of method to be invoked
Returns:
result of method invocation
Throws:
IllegalArgumentException - if method does not exist or is not public, method returns void or method accepts any argument


Copyright © 2013–2015 AssertJ. All rights reserved.