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 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(); }
    }