Comparable<ModuleDescriptor.Provides>
ModuleDescriptor
public static final class ModuleDescriptor.Provides extends Object implements Comparable<ModuleDescriptor.Provides>
A service that a module provides one or more implementations of.
Modifier and Type | Method | Description |
---|---|---|
int |
compareTo |
Compares this Provides to another. |
boolean |
equals |
Tests this Provides for equality with the given object. |
int |
hashCode() |
Computes a hash code for this Provides . |
List |
providers() |
Returns the list of the fully qualified class names of the providers or provider factories. |
String |
service() |
Returns the fully qualified class name of the service type. |
String |
toString() |
Returns a string describing this Provides . |
public String service()
public List<String> providers()
public int compareTo(ModuleDescriptor.Provides that)
Provides
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 first N
corresponding elements are equal, then the longer list is considered to succeed the shorter list.
compareTo
in interface Comparable<ModuleDescriptor.Provides>
that
- The Provides
to compareProvides
is less than, equal to, or greater than the given Provides
public int hashCode()
Provides
. The hash code is based upon the service type and the set of providers. It satisfies the general contract of the Object.hashCode
method.
public boolean equals(Object ob)
Provides
for equality with the given object. If the given object is not a Provides
then this method returns false
. Two Provides
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.
public String toString()
Provides
.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/module/ModuleDescriptor.Provides.html