Package Summary Overview Summary |
java.lang.Comparable<ModuleDescriptor.Requires>
public static final class ModuleDescriptor.Requires extends java.lang.Object implements java.lang.Comparable<ModuleDescriptor.Requires>
A dependence upon a module
ModuleDescriptor.requires()
Modifier and Type | Class | Description |
---|---|---|
static class | ModuleDescriptor.Requires.Modifier |
A modifier on a module dependence.
|
Modifier and Type | Method | Description |
---|---|---|
int | compareTo(ModuleDescriptor.Requires that) |
Compares this module dependence to another.
|
java.util.Optional<ModuleDescriptor.Version> | compiledVersion() |
Returns the version of the module if recorded at compile-time.
|
boolean | equals(java.lang.Object ob) |
Tests this module dependence for equality with the given object.
|
int | hashCode() |
Computes a hash code for this module dependence.
|
java.util.Set<ModuleDescriptor.Requires.Modifier> | modifiers() |
Returns the set of modifiers.
|
java.lang.String | name() |
Return the module name.
|
java.util.Optional<java.lang.String> | rawCompiledVersion() |
Returns the string with the possibly-unparseable version of the module if recorded at compile-time.
|
java.lang.String | toString() |
Returns a string describing this module dependence.
|
public java.util.Set<ModuleDescriptor.Requires.Modifier> modifiers()
public java.lang.String name()
public java.util.Optional<ModuleDescriptor.Version> compiledVersion()
Optional
if no version was recorded or the version string recorded is unparseable
public java.util.Optional<java.lang.String> rawCompiledVersion()
Optional
if no version was recorded compiledVersion()
public int compareTo(ModuleDescriptor.Requires that)
Two Requires
objects 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 (see ModuleDescriptor.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.
compareTo
in interface java.lang.Comparable<ModuleDescriptor.Requires>
that
- The module dependence to compare public boolean equals(java.lang.Object ob)
If the given object is not a Requires
then this method returns false
. 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.equals
method.
equals
in class java.lang.Object
ob
- the object to which this object is to be compared true
if, and only if, the given object is a module dependence that is equal to this module dependence Object.hashCode()
, HashMap
public int hashCode()
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.hashCode
method.
hashCode
in class java.lang.Object
Object.equals(java.lang.Object)
, System.identityHashCode(java.lang.Object)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1993, 2017, Oracle and/or its affiliates · All rights reserved · License