Class AbstractServiceEntry

java.lang.Object
io.micronaut.discovery.consul.client.v1.AbstractServiceEntry
Direct Known Subclasses:
NewServiceEntry, ServiceEntry

@Introspected public abstract class AbstractServiceEntry extends Object
Base class for a service entry in consul.
Since:
1.0
Author:
graemerocher
  • Field Details

    • name

      protected final String name
  • Constructor Details

    • AbstractServiceEntry

      public AbstractServiceEntry(String name)
      Parameters:
      name - The service name
  • Method Details

    • getID

      public Optional<String> getID()
      See https://www.consul.io/api/agent/service.html#id.
      Returns:
      The ID of the service
    • setID

      public void setID(String id)
      See https://www.consul.io/api/agent/service.html#id.
      Parameters:
      id - The ID of the service
    • getAddress

      public Optional<InetAddress> getAddress()
      See https://www.consul.io/api/agent/service.html#address.
      Returns:
      The address of the service
    • setAddress

      public void setAddress(InetAddress address)
      See https://www.consul.io/api/agent/service.html#address.
      Parameters:
      address - The address of the service
    • getPort

      public OptionalInt getPort()
      See https://www.consul.io/api/agent/service.html#address.
      Returns:
      The port of the service
    • setPort

      public void setPort(Integer port)
      See https://www.consul.io/api/agent/service.html#address.
      Parameters:
      port - The port of the service
    • getTags

      public List<String> getTags()
      See https://www.consul.io/api/agent/service.html#tags.
      Returns:
      The service tags
    • setTags

      public void setTags(List<String> tags)
      See https://www.consul.io/api/agent/service.html#tags.
      Parameters:
      tags - The service tags
    • getMeta

      public Map<String,String> getMeta()
      See https://www.consul.io/api/agent/service.html#meta.
      Returns:
      The service metadata
    • setMeta

      public void setMeta(Map<String,String> meta)
      See https://www.consul.io/api/agent/service.html#meta.
      Parameters:
      meta - The service metadata
    • getName

      public String getName()
      See https://www.consul.io/api/agent/service.html#name.
      Returns:
      The name of the service
    • id

      public AbstractServiceEntry id(String id)
      Parameters:
      id - The id of the service
      Returns:
      The AbstractServiceEntry instance
    • address

      public AbstractServiceEntry address(InetAddress address)
      Parameters:
      address - The InetAddress of the service
      Returns:
      The AbstractServiceEntry instance
    • address

      public AbstractServiceEntry address(String address)
      Parameters:
      address - The address of the service
      Returns:
      The AbstractServiceEntry instance
    • port

      public AbstractServiceEntry port(Integer port)
      Parameters:
      port - The port of the service
      Returns:
      The AbstractServiceEntry instance
    • tags

      public AbstractServiceEntry tags(List<String> tags)
      Parameters:
      tags - The service tags
      Returns:
      The AbstractServiceEntry instance
    • meta

      public AbstractServiceEntry meta(Map<String,String> meta)
      Parameters:
      meta - The service metadata
      Returns:
      The AbstractServiceEntry instance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object