Class ApiMethodImpl
java.lang.Object
org.apache.camel.support.component.ApiMethodImpl
- All Implemented Interfaces:
ApiMethod
Delegate class for
ApiMethod
. This class is instantiated by Enumerations for Api Proxy types.
For example:
public enum HelloWorldMethod implements ApiMethod {
SAYHI(String.class, "sayHi", ApiMethodArg.from(String.class, "name");
private ApiMethodImpl apiMethod;
private HelloWorldMethods(Class<?> resultType, String name, ApiMethodArg... args) throws IllegalArgumentException {
this.apiMethod = new ApiMethod(HelloWorld.class, resultType, name, args);
}
// implement ApiMethod interface
String getName() { return apiMethod.getName(); }
Class<?> getResultType() {return apiMethod.getResultType(); }
List<String> getArgNames() { return apiMethod.getArgNames(); }
List<Class<?>> getArgTypes() {return apiMethod.getArgTypes(); }
Method getMethod() { return apiMethod.getMethod(); }
}
-
Constructor Summary
ConstructorsConstructorDescriptionApiMethodImpl
(Class<?> proxyType, Class<?> resultType, String name, ApiMethodArg... args) -
Method Summary
-
Constructor Details
-
ApiMethodImpl
public ApiMethodImpl(Class<?> proxyType, Class<?> resultType, String name, ApiMethodArg... args) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
-
Method Details
-
getName
Description copied from interface:ApiMethod
Returns method name. -
getResultType
Description copied from interface:ApiMethod
Returns method result type.- Specified by:
getResultType
in interfaceApiMethod
- Returns:
- result type
-
getArgNames
Description copied from interface:ApiMethod
Returns method argument names.- Specified by:
getArgNames
in interfaceApiMethod
- Returns:
- argument names
-
getArgTypes
Description copied from interface:ApiMethod
Return method argument types.- Specified by:
getArgTypes
in interfaceApiMethod
- Returns:
- argument types
-
getMethod
Description copied from interface:ApiMethod
ReturnsMethod
in proxy type. -
toString
-