r01f.reflection.fluent
Class StaticMethodReturnTypes.StaticMethodReturnType<T>

java.lang.Object
  extended by r01f.reflection.fluent.StaticMethodReturnTypes.StaticMethodReturnType<T>
Type Parameters:
T - the generic type of the static method's return type. Usage example:
   // Equivalent to call 'Jedi.setCommonPower("Jump")'
   Reflection.staticMethod("setCommonPower").withParameterTypes(String.class).in(Jedi.class).invoke("Jump");
 
   // Equivalent to call 'Jedi.addPadawan()'
   Reflection.staticMethod("addPadawan").in(Jedi.class).invoke();
 
   // Equivalent to call 'Jedi.commonPowerCount()'
   String name = Reflection.staticMethod("commonPowerCount").withReturnType(String.class).in(Jedi.class).invoke();
 
Enclosing class:
StaticMethodReturnTypes

public static class StaticMethodReturnTypes.StaticMethodReturnType<T>
extends java.lang.Object

Return type of the static method to invoke.


Field Summary
private  java.lang.String _methodName
           
 
Constructor Summary
StaticMethodReturnTypes.StaticMethodReturnType(java.lang.String methodName)
           
 
Method Summary
 MethodInvoker<T> in(java.lang.Class<?> target)
          Creates a new method invoker.
 StaticMethodParameterTypes<T> withParameterTypes(java.lang.Class<?>... parameterTypes)
          Specifies the parameter types of the static method to invoke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_methodName

private final java.lang.String _methodName
Constructor Detail

StaticMethodReturnTypes.StaticMethodReturnType

StaticMethodReturnTypes.StaticMethodReturnType(java.lang.String methodName)
Method Detail

in

public MethodInvoker<T> in(java.lang.Class<?> target)
Creates a new method invoker.

Parameters:
target - the object containing the method to invoke.
Returns:
the created method invoker.
Throws:
java.lang.NullPointerException - if the given target is null.

withParameterTypes

public StaticMethodParameterTypes<T> withParameterTypes(java.lang.Class<?>... parameterTypes)
Specifies the parameter types of the static method to invoke. This method call is optional if the method to invoke does not take arguments.

Parameters:
parameterTypes - the parameter types of the method to invoke.
Returns:
the created parameter types holder.
Throws:
java.lang.NullPointerException - if the array of parameter types is null.