Record Class DefaultKubernetesServiceInstance

java.lang.Object
java.lang.Record
org.springframework.cloud.kubernetes.commons.discovery.DefaultKubernetesServiceInstance
Record Components:
instanceId - the id of the instance.
serviceId - the id of the service.
host - the address where the service instance can be found.
port - the port on which the service is running.
metadata - a map containing metadata.
secure - indicates whether the connection needs to be secure.
namespace - the namespace of the service.
cluster - the cluster the service resides in.
All Implemented Interfaces:
Serializable, org.springframework.cloud.client.ServiceInstance, KubernetesServiceInstance

public record DefaultKubernetesServiceInstance(String instanceId, String serviceId, String host, int port, Map<String,String> metadata, boolean secure, String namespace, String cluster, Map<String, Map<String,String>> podMetadata) extends Record implements KubernetesServiceInstance, Serializable
Author:
wind57
See Also:
  • Constructor Details

    • DefaultKubernetesServiceInstance

      public DefaultKubernetesServiceInstance(String instanceId, String serviceId, String host, int port, Map<String,String> metadata, boolean secure, String namespace, String cluster, Map<String, Map<String,String>> podMetadata)
      Creates an instance of a DefaultKubernetesServiceInstance record class.
      Parameters:
      instanceId - the value for the instanceId record component
      serviceId - the value for the serviceId record component
      host - the value for the host record component
      port - the value for the port record component
      metadata - the value for the metadata record component
      secure - the value for the secure record component
      namespace - the value for the namespace record component
      cluster - the value for the cluster record component
      podMetadata - the value for the podMetadata record component
  • Method Details

    • getInstanceId

      public String getInstanceId()
      Specified by:
      getInstanceId in interface org.springframework.cloud.client.ServiceInstance
    • getServiceId

      public String getServiceId()
      Specified by:
      getServiceId in interface org.springframework.cloud.client.ServiceInstance
    • getHost

      public String getHost()
      Specified by:
      getHost in interface org.springframework.cloud.client.ServiceInstance
    • getPort

      public int getPort()
      Specified by:
      getPort in interface org.springframework.cloud.client.ServiceInstance
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface org.springframework.cloud.client.ServiceInstance
    • getUri

      public URI getUri()
      Specified by:
      getUri in interface org.springframework.cloud.client.ServiceInstance
    • getMetadata

      public Map<String,String> getMetadata()
      Specified by:
      getMetadata in interface org.springframework.cloud.client.ServiceInstance
    • getScheme

      public String getScheme()
      Specified by:
      getScheme in interface org.springframework.cloud.client.ServiceInstance
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface KubernetesServiceInstance
    • getCluster

      public String getCluster()
      Specified by:
      getCluster in interface KubernetesServiceInstance
    • podMetadata

      public Map<String, Map<String,String>> podMetadata()
      Returns the value of the podMetadata record component.
      Specified by:
      podMetadata in interface KubernetesServiceInstance
      Returns:
      the value of the podMetadata record component
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • instanceId

      public String instanceId()
      Returns the value of the instanceId record component.
      Returns:
      the value of the instanceId record component
    • serviceId

      public String serviceId()
      Returns the value of the serviceId record component.
      Returns:
      the value of the serviceId record component
    • host

      public String host()
      Returns the value of the host record component.
      Returns:
      the value of the host record component
    • port

      public int port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component
    • metadata

      public Map<String,String> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • secure

      public boolean secure()
      Returns the value of the secure record component.
      Returns:
      the value of the secure record component
    • namespace

      public String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • cluster

      public String cluster()
      Returns the value of the cluster record component.
      Returns:
      the value of the cluster record component