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:
- The return values of invocations of their
getClass()
methods are equal, and - The return values of invocations of their
uri()
methods are equal
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
Returns a determinate hashcode for thisDiscoveredUri
.metadata()
Returns a determinate, immutableMap
of metadata further describing thisDiscoveredUri
implementation.uri()
Returns the non-null
, determinateURI
component of thisDiscoveredUri
that it fundamentally represents.
-
Method Details
-
equals
Returnstrue
if and only if the suppliedObject
is equal to thisDiscoveredUri
.For implementations of this method to return
true
, the suppliedObject
:- Must have a
Class
that is equal to thisDiscoveredUri
'sClass
, and - Must have a
URI
equal to thisDiscoveredUri
'sURI
Implementations of this method must return determinate values.
Note: This specification notably and deliberately excludes metadata from equality calculations.
- Overrides:
equals
in classObject
- Parameters:
other
- anObject
to test; may benull
in which casefalse
must be returned- Returns:
true
if and only if the suppliedObject
is equal to thisDiscoveredUri
- See Also:
- Must have a
-
hashCode
int hashCode()Returns a determinate hashcode for thisDiscoveredUri
.Implementations of this method must compute a hashcode based only on the return value of an invocation of the
uri()
method.- Overrides:
hashCode
in classObject
- Returns:
- a determinate hashcode for this
DiscoveredUri
- See Also:
-
metadata
Returns a determinate, immutableMap
of metadata further describing thisDiscoveredUri
implementation.Keys in
Map
s returned by invocations of implementations of this method that begin with the prefixio.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 aDiscoveredUri
. 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
, immutableMap
of metadata - See Also:
-
uri
URI uri()Returns the non-null
, determinateURI
component of thisDiscoveredUri
that it fundamentally represents.- Returns:
- a non-
null
, determinateURI
that thisDiscoveredUri
fundamentally represents
-