io.vertx.servicediscovery.types

## Class HttpLocation

- java.lang.Object
- - io.vertx.servicediscovery.types.HttpLocation

-     public class HttpLocation
      extends Object

  Represents the location of a HTTP endpoint. This object (its json representation) will be used as "location" in a service record.
  Author:
    Clement Escoffier

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpLocation()` Creates a new `HttpLocation` instance.
    `HttpLocation(HttpLocation other)` Creates a new `HttpLocation` instance by copying another instance.
    `HttpLocation(JsonObject json)` Creates a new `HttpLocation` from the given json object

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEndpoint()`
    `String` | `getHost()`
    `int` | `getPort()`
    `String` | `getRoot()`
    `boolean` | `isSsl()`
    `HttpLocation` | `setEndpoint(String endpoint)` Sets the endpoint, which is the URL of the service.
    `HttpLocation` | `setHost(String host)` Sets the host.
    `HttpLocation` | `setPort(int port)` Sets the port
    `HttpLocation` | `setRoot(String root)` Sets the path of the service (root)
    `HttpLocation` | `setSsl(boolean ssl)` Sets whether or not the HTTP service is using `https`.
    `JsonObject` | `toJson()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpLocation

          public HttpLocation()

      Creates a new `HttpLocation` instance.

    - #### HttpLocation

          public HttpLocation(HttpLocation other)

      Creates a new `HttpLocation` instance by copying another instance.
      Parameters:
        `other` - the instance fo copy

    - #### HttpLocation

          public HttpLocation(JsonObject json)

      Creates a new `HttpLocation` from the given json object
      Parameters:
        `json` - the json object

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Returns:
        a json representation of the current `HttpLocation`.

    - #### getHost

          public String getHost()

      Returns:
        the host

    - #### setHost

          public HttpLocation setHost(String host)

      Sets the host.
      Parameters:
        `host` - the host
      Returns:
        the current `HttpLocation`

    - #### setEndpoint

          public HttpLocation setEndpoint(String endpoint)

      Sets the endpoint, which is the URL of the service. The endpoint is automatically computed when you use the other `setX` method.
      Parameters:
        `endpoint` - the endpoint
      Returns:
        the current `HttpLocation`

    - #### getEndpoint

          public String getEndpoint()

      Returns:
        the URL of the service

    - #### getPort

          public int getPort()

      Returns:
        the port.

    - #### setPort

          public HttpLocation setPort(int port)

      Sets the port
      Parameters:
        `port` - the port
      Returns:
        the current `HttpLocation`

    - #### getRoot

          public String getRoot()

      Returns:
        the path of the service (root)

    - #### setRoot

          public HttpLocation setRoot(String root)

      Sets the path of the service (root)
      Parameters:
        `root` - the root
      Returns:
        the current `HttpLocation`

    - #### setSsl

          public HttpLocation setSsl(boolean ssl)

      Sets whether or not the HTTP service is using `https`.
      Parameters:
        `ssl` - `true` to denotes that the service use `https`
      Returns:
        the current `HttpLocation`

    - #### isSsl

          public boolean isSsl()

      Returns:
        `true` if the location is using `https`, `false` otherwise.

Copyright © 2022 Eclipse. All rights reserved.