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.MethodgetMethod()ReturnsMethodin proxy type.StringgetName()Returns method name.Class<?>getResultType()Returns method result type.StringtoString()
-
-
-
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:ApiMethodReturns method result type.- Specified by:
getResultTypein interfaceApiMethod- Returns:
- result type
-
getArgNames
public List<String> getArgNames()
Description copied from interface:ApiMethodReturns method argument names.- Specified by:
getArgNamesin interfaceApiMethod- Returns:
- argument names
-
getArgTypes
public List<Class<?>> getArgTypes()
Description copied from interface:ApiMethodReturn method argument types.- Specified by:
getArgTypesin interfaceApiMethod- Returns:
- argument types
-
getMethod
public Method getMethod()
Description copied from interface:ApiMethodReturnsMethodin proxy type.
-
-