- All Implemented Interfaces:
Comparable<ModuleDescriptor.Provides>
- Enclosing class:
- ModuleDescriptor
A service that a module provides one or more implementations of.
- Since:
- 9
- See Also:
ModuleDescriptor.provides()
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares thisProvides
to another.boolean
Tests thisProvides
for equality with the given object.int
hashCode()
Computes a hash code for thisProvides
.Returns the list of the fully qualified class names of the providers or provider factories.service()
Returns the fully qualified class name of the service type.toString()
Returns a string describing thisProvides
.
-
Method Details
-
service
Returns the fully qualified class name of the service type.- Returns:
- The fully qualified class name of the service type
-
providers
Returns the list of the fully qualified class names of the providers or provider factories.- Returns:
- A non-empty and unmodifiable list of the fully qualified class names of the providers or provider factories
-
compareTo
Compares thisProvides
to another.Two
Provides
objects are compared by comparing the fully qualified class name of the service type lexicographically. Where the class names are equal then the list of the provider class names are compared by comparing the corresponding elements of both lists lexicographically and in sequence. Where the lists differ in size,N
is the size of the shorter list, and the firstN
corresponding elements are equal, then the longer list is considered to succeed the shorter list.- Specified by:
compareTo
in interfaceComparable<ModuleDescriptor.Provides>
- Parameters:
that
- TheProvides
to compare- Returns:
- A negative integer, zero, or a positive integer if this
Provides
is less than, equal to, or greater than the givenProvides
-
hashCode
public int hashCode()Computes a hash code for thisProvides
.The hash code is based upon the service type and the set of providers. It satisfies the general contract of the
Object.hashCode
method.- Overrides:
hashCode
in classObject
- Returns:
- The hash-code value for this module provides
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
equals
Tests thisProvides
for equality with the given object.If the given object is not a
Provides
then this method returnsfalse
. TwoProvides
objects are equal if the service type is equal and the list of providers is equal.This method satisfies the general contract of the
Object.equals
method.- Overrides:
equals
in classObject
- Parameters:
ob
- the object to which this object is to be compared- Returns:
true
if, and only if, the given object is aProvides
that is equal to thisProvides
- See Also:
Object.hashCode()
,HashMap
-
toString
Returns a string describing thisProvides
.
-