Package io.vertx.core.net

## Interface AddressResolver<A extends Address>

-     @Unstable
      public interface AddressResolver<A extends Address>

  A provider for address resolver.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `EndpointResolver<A,​?,​?,​?>` | `endpointResolver​(Vertx vertx)` | Return a resolver capable of resolving addresses to endpoints.
    `static <A extends Address> AddressResolver<A>` | `mappingResolver​(Function<A,​List<SocketAddress>> mapping)` | A simple synchronous resolver for demo and testing purposes.

- - ### Method Detail

    - #### mappingResolver

          static <A extends Address> AddressResolver<A> mappingResolver​(Function<A,​List<SocketAddress>> mapping)

      A simple synchronous resolver for demo and testing purposes.

      The returned resolver uses the `mapping` function to obtain a list of endpoints for a given address. The resolver calls the mapping function when it needs to select an endpoint node.

      The load balancing state of a given address is reset when the list of endpoints returned by the function has changed. Therefore, when the function returns the same list of endpoints, the load balancing state is preserved.

      When the `mapping` returns `null` or an empty list, implies the endpoint is not valid anymore and fails the server selection.

      Parameters:
        `mapping` - the mapping function
      Returns:
        an address resolver

    - #### endpointResolver

          EndpointResolver<A,​?,​?,​?> endpointResolver​(Vertx vertx)

      Return a resolver capable of resolving addresses to endpoints.
      Parameters:
        `vertx` - the vertx instance
      Returns:
        the resolver