ModuleDescriptor.Provides (Java SE 9 & JDK 9 ) (original) (raw)
- java.lang.module.ModuleDescriptor.Provides
All Implemented Interfaces:
[Comparable](../../../java/lang/Comparable.html "interface in java.lang")<[ModuleDescriptor.Provides](../../../java/lang/module/ModuleDescriptor.Provides.html "class in java.lang.module")>
Enclosing class:
ModuleDescriptor
public static final class ModuleDescriptor.Provides
extends Object
implements Comparable<ModuleDescriptor.Provides>
A service that a module provides one or more implementations of.
Since:
9
See Also:
ModuleDescriptor.provides()
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description int compareTo(ModuleDescriptor.Provides that) Compares this provides to another. boolean equals(Object ob) Tests this provides for equality with the given object. int hashCode() Computes a hash code for this provides. List<String> 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. * ### Methods inherited from class java.lang.[Object](../../../java/lang/Object.html "class in java.lang") `[clone](../../../java/lang/Object.html#clone--), [finalize](../../../java/lang/Object.html#finalize--), [getClass](../../../java/lang/Object.html#getClass--), [notify](../../../java/lang/Object.html#notify--), [notifyAll](../../../java/lang/Object.html#notifyAll--), [wait](../../../java/lang/Object.html#wait--), [wait](../../../java/lang/Object.html#wait-long-), [wait](../../../java/lang/Object.html#wait-long-int-)`
Method Detail
* #### service public [String](../../../java/lang/String.html "class in java.lang") service() Returns the fully qualified class name of the service type. Returns: The fully qualified class name of the service type * #### providers public [List](../../../java/util/List.html "interface in java.util")<[String](../../../java/lang/String.html "class in java.lang")> 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 public int compareTo([ModuleDescriptor.Provides](../../../java/lang/module/ModuleDescriptor.Provides.html "class in java.lang.module") that) Compares this 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. Specified by: `[compareTo](../../../java/lang/Comparable.html#compareTo-T-)` in interface `[Comparable](../../../java/lang/Comparable.html "interface in java.lang")<[ModuleDescriptor.Provides](../../../java/lang/module/ModuleDescriptor.Provides.html "class in java.lang.module")>` Parameters: `that` \- The `Provides` to compare Returns: A negative integer, zero, or a positive integer if this provides is less than, equal to, or greater than the given provides * #### hashCode public int hashCode() Computes a hash code for this provides. The hash code is based upon the service type and the set of providers. It satisfies the general contract of the [Object.hashCode](../../../java/lang/Object.html#hashCode--) method. Overrides: `[hashCode](../../../java/lang/Object.html#hashCode--)` in class `[Object](../../../java/lang/Object.html "class in java.lang")` Returns: The hash-code value for this module provides See Also: [Object.equals(java.lang.Object)](../../../java/lang/Object.html#equals-java.lang.Object-), [System.identityHashCode(java.lang.Object)](../../../java/lang/System.html#identityHashCode-java.lang.Object-) * #### equals public boolean equals([Object](../../../java/lang/Object.html "class in java.lang") ob) Tests this 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](../../../java/lang/Object.html#equals-java.lang.Object-) method. Overrides: `[equals](../../../java/lang/Object.html#equals-java.lang.Object-)` in class `[Object](../../../java/lang/Object.html "class in java.lang")` Parameters: `ob` \- the object to which this object is to be compared Returns: `true` if, and only if, the given object is a`Provides` that is equal to this `Provides` See Also: [Object.hashCode()](../../../java/lang/Object.html#hashCode--), [HashMap](../../../java/util/HashMap.html "class in java.util") * #### toString public [String](../../../java/lang/String.html "class in java.lang") toString() Returns a string describing this provides. Overrides: `[toString](../../../java/lang/Object.html#toString--)` in class `[Object](../../../java/lang/Object.html "class in java.lang")` Returns: A string describing this provides
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.