Class RestProxy

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public final class RestProxy
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Type to create a proxy implementation for an interface describing REST API methods. RestProxy can create proxy implementations for interfaces with methods that produces deserialized Java objects.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <A> A create​(java.lang.Class<A> swaggerInterface, com.azure.android.core.http.HttpPipeline httpPipeline, com.azure.android.core.serde.jackson.JacksonSerder jacksonSerder)
      Create a proxy implementation of the provided Swagger interface.
      java.lang.Object invoke​(java.lang.Object restProxy, java.lang.reflect.Method swaggerMethod, java.lang.Object[] swaggerMethodArgs)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static <A> A create​(java.lang.Class<A> swaggerInterface,
                                   com.azure.android.core.http.HttpPipeline httpPipeline,
                                   com.azure.android.core.serde.jackson.JacksonSerder jacksonSerder)
        Create a proxy implementation of the provided Swagger interface.
        Type Parameters:
        A - the type of the Swagger interface.
        Parameters:
        swaggerInterface - the Swagger interface to provide a proxy implementation for.
        httpPipeline - the HttpPipelinePolicy and HttpClient pipeline that will be used to send Http requests.
        jacksonSerder - the serializer that will be used to convert POJOs to and from request and response bodies
        Returns:
        a proxy implementation of the provided Swagger interface.
      • invoke

        public java.lang.Object invoke​(java.lang.Object restProxy,
                                       java.lang.reflect.Method swaggerMethod,
                                       java.lang.Object[] swaggerMethodArgs)
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler