Class ModuleDescriptor.Requires
- All Implemented Interfaces:
Comparable<ModuleDescriptor.Requires>
- Enclosing class:
ModuleDescriptor
A dependence upon a module.
- Since:
- 9
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA modifier on a module dependence. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of the module requires flags.intCompares this module dependence to another.Returns the version of the module if recorded at compile-time.booleanTests this module dependence for equality with the given object.inthashCode()Computes a hash code for this module dependence.Returns the set of modifiers.name()Return the module name.Returns the string with the possibly-unparseable version of the module if recorded at compile-time.toString()Returns a string describing this module dependence.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
modifiers
Returns the set of modifiers.- Returns:
- A possibly-empty unmodifiable set of modifiers
-
accessFlags
Returns the set of the module requires flags.- Returns:
- A possibly-empty unmodifiable set of requires flags
- See Java Virtual Machine Specification:
-
4.7.25 The Module Attribute
- Since:
- 20
- See Also:
-
name
-
compiledVersion
Returns the version of the module if recorded at compile-time.- Returns:
- The version of the module if recorded at compile-time,
or an empty
Optionalif no version was recorded or the version string recorded is unparseable
-
rawCompiledVersion
-
compareTo
Compares this module dependence to another.Two
Requiresobjects are compared by comparing their module names lexicographically. Where the module names are equal then the sets of modifiers are compared in the same way that module modifiers are compared (seeModuleDescriptor.compareTo). Where the module names are equal and the set of modifiers are equal then the version of the modules recorded at compile-time are compared. When comparing the versions recorded at compile-time then a dependence that has a recorded version is considered to succeed a dependence that does not have a recorded version. If both recorded versions are unparseable then the raw version strings are compared lexicographically.- Specified by:
compareToin interfaceComparable<ModuleDescriptor.Requires>- Parameters:
that- The module dependence to compare- Returns:
- A negative integer, zero, or a positive integer if this module dependence is less than, equal to, or greater than the given module dependence
-
equals
Tests this module dependence for equality with the given object.If the given object is not a
Requiresthen this method returnsfalse. Two module dependence objects are equal if the module names are equal, set of modifiers are equal, and the compiled version of both modules is equal or not recorded for both modules.This method satisfies the general contract of the
Object.equalsmethod. -
hashCode
public int hashCode()Computes a hash code for this module dependence.The hash code is based upon the module name, modifiers, and the module version if recorded at compile time. It satisfies the general contract of the
Object.hashCodemethod. -
toString
-