Interface DiscoveredUri


public interface DiscoveredUri
A representation of a discovered URI, often supplied by invocations of an implementation of the Discovery.uris(String, URI) method.

A DiscoveredUri implementation must be immutable in all possible respects.

Equality

Two DiscoveredUri implementations are considered equal if and only if:

  1. The return values of invocations of their getClass() methods are equal, and
  2. The return values of invocations of their uri() methods are equal
See Also:
  • Method Details

    • equals

      boolean equals(Object other)
      Returns true if and only if the supplied Object is equal to this DiscoveredUri.

      For implementations of this method to return true, the supplied Object:

      Implementations of this method must return determinate values.

      Note: This specification notably and deliberately excludes metadata from equality calculations.

      Overrides:
      equals in class Object
      Parameters:
      other - an Object to test; may be null in which case false must be returned
      Returns:
      true if and only if the supplied Object is equal to this DiscoveredUri
      See Also:
    • hashCode

      int hashCode()
      Returns a determinate hashcode for this DiscoveredUri.

      Implementations of this method must compute a hashcode based only on the return value of an invocation of the uri() method.

      Overrides:
      hashCode in class Object
      Returns:
      a determinate hashcode for this DiscoveredUri
      See Also:
    • metadata

      default Map<String,String> metadata()
      Returns a determinate, immutable Map of metadata further describing this DiscoveredUri implementation.

      Keys in Maps returned by invocations of implementations of this method that begin with the prefix io.helidon.discovery. are reserved for internal use by implementations.

      The default implementation returns the return value of an invocation of the Map.of() method, indicating that by default there is no metadata associated with a DiscoveredUri. Overrides are expected and encouraged.

      Note: The return value of invocations of implementations of this method must be excluded from hashcode and equality calculations.

      Returns:
      a non-null, immutable Map of metadata
      See Also:
    • uri

      URI uri()
      Returns the non-null, determinate URI component of this DiscoveredUri that it fundamentally represents.
      Returns:
      a non-null, determinate URI that this DiscoveredUri fundamentally represents