Class ApiMethodImpl
- java.lang.Object
-
- org.apache.camel.support.component.ApiMethodImpl
-
- All Implemented Interfaces:
ApiMethod
public final class ApiMethodImpl extends Object implements ApiMethod
Delegate class forApiMethod
. 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
Constructors Constructor Description ApiMethodImpl(Class<?> proxyType, Class<?> resultType, String name, ApiMethodArg... args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getArgNames()
Returns method argument names.List<Class<?>>
getArgTypes()
Return method argument types.Method
getMethod()
ReturnsMethod
in proxy type.String
getName()
Returns method name.Class<?>
getResultType()
Returns method result type.String
toString()
-
-
-
Constructor Detail
-
ApiMethodImpl
public ApiMethodImpl(Class<?> proxyType, Class<?> resultType, String name, ApiMethodArg... args) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
getResultType
public Class<?> getResultType()
Description copied from interface:ApiMethod
Returns method result type.- Specified by:
getResultType
in interfaceApiMethod
- Returns:
- result type
-
getArgNames
public List<String> getArgNames()
Description copied from interface:ApiMethod
Returns method argument names.- Specified by:
getArgNames
in interfaceApiMethod
- Returns:
- argument names
-
getArgTypes
public List<Class<?>> getArgTypes()
Description copied from interface:ApiMethod
Return method argument types.- Specified by:
getArgTypes
in interfaceApiMethod
- Returns:
- argument types
-
getMethod
public Method getMethod()
Description copied from interface:ApiMethod
ReturnsMethod
in proxy type.
-
-