- java.lang.Object
- 
- java.lang.module.ModuleDescriptor.Provides
 
- 
- All Implemented Interfaces:
- Comparable<ModuleDescriptor.Provides>
 - 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 SummaryModifier and Type Method Description intcompareTo(ModuleDescriptor.Provides that)Compares this provides to another.booleanequals(Object ob)Tests this provides for equality with the given object.inthashCode()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.Stringservice()Returns the fully qualified class name of the service type.StringtoString()Returns a string describing this provides.
 
- 
- 
- 
Method Detail- 
servicepublic String service() Returns the fully qualified class name of the service type.- Returns:
- The fully qualified class name of the service type
 
 - 
providerspublic List<String> 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
 
 - 
compareTopublic int compareTo(ModuleDescriptor.Provides that) Compares this provides to another.Two Providesobjects 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,Nis the size of the shorter list, and the firstNcorresponding elements are equal, then the longer list is considered to succeed the shorter list.- Specified by:
- compareToin interface- Comparable<ModuleDescriptor.Provides>
- Parameters:
- that- The- Providesto compare
- Returns:
- A negative integer, zero, or a positive integer if this provides is less than, equal to, or greater than the given provides
 
 - 
hashCodepublic 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.hashCodemethod.- Overrides:
- hashCodein class- Object
- Returns:
- The hash-code value for this module provides
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
equalspublic boolean equals(Object ob) Tests this provides for equality with the given object.If the given object is not a Providesthen this method returnsfalse. TwoProvidesobjects are equal if the service type is equal and the list of providers is equal.This method satisfies the general contract of the Object.equalsmethod.- Overrides:
- equalsin class- Object
- Parameters:
- ob- the object to which this object is to be compared
- Returns:
- trueif, and only if, the given object is a- Providesthat is equal to this- Provides
- See Also:
- Object.hashCode(),- HashMap
 
 
- 
 
-