# Class ModuleDescriptor.Exports

java.lang.Object
java.lang.module.ModuleDescriptor.Exports

All Implemented Interfaces:
  `Comparable<ModuleDescriptor.Exports>`

Enclosing class:
  `ModuleDescriptor`

public static final class ModuleDescriptor.Exports extends Object implements Comparable<ModuleDescriptor.Exports>

A package exported by a module, may be qualified or unqualified.

Since:
  9
See Also:
  - `ModuleDescriptor.exports()`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`ModuleDescriptor.Exports.Modifier`
A modifier on an exported package.

## Method Summary

Modifier and Type
Method
Description
`Set<AccessFlag>`
`accessFlags()`
Returns the set of the module export flags for this module descriptor.
`int`
`compareTo(ModuleDescriptor.Exports that)`
Compares this module export to another.
`boolean`
`equals(Object ob)`
Tests this module export for equality with the given object.
`int`
`hashCode()`
Computes a hash code for this module export.
`boolean`
`isQualified()`
Returns `true` if this is a qualified export.
`Set<ModuleDescriptor.Exports.Modifier>`
`modifiers()`
Returns the set of modifiers.
`String`
`source()`
Returns the package name.
`Set<String>`
`targets()`
For a qualified export, returns the non-empty and immutable set of the module names to which the package is exported.
`String`
`toString()`
Returns a string describing the exported package.

### Methods declared in class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
Modifier and Type
Method
Description
`protected Object`
`clone()`
Creates and returns a copy of this object.
`protected void`
`finalize()`
Deprecated, for removal: This API element is subject to removal in a future version.
Finalization is deprecated and subject to removal in a future release.
`final Class<?>`
`getClass()`
Returns the runtime class of this `Object`.
`final void`
`notify()`
Wakes up a single thread that is waiting on this object's monitor.
`final void`
`notifyAll()`
Wakes up all threads that are waiting on this object's monitor.
`final void`
`wait()`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
`final void`
`wait(long timeoutMillis)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
`final void`
`wait(long timeoutMillis, int nanos)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

## Method Details

### modifiers

public Set<ModuleDescriptor.Exports.Modifier> modifiers()
Returns the set of modifiers.

Returns:
  A possibly-empty unmodifiable set of modifiers

### accessFlags

public Set<AccessFlag> accessFlags()
Returns the set of the module export flags for this module descriptor.

Returns:
  A possibly-empty unmodifiable set of export flags
See Java Virtual Machine Specification:
  4.7.25 The Module Attribute
Since:
  20
See Also:
  - `modifiers()`

### isQualified

public boolean isQualified()
Returns `true` if this is a qualified export.

Returns:
  `true` if this is a qualified export

### source

public String source()
Returns the package name.

Returns:
  The package name

### targets

public Set<String> targets()
For a qualified export, returns the non-empty and immutable set of the module names to which the package is exported. For an unqualified export, returns an empty set.

Returns:
  The set of target module names or for an unqualified export, an empty set

### compareTo

public int compareTo(ModuleDescriptor.Exports that)
Compares this module export to another.

Two `Exports` objects are compared by comparing the package names lexicographically. Where the packages names are equal then the sets of modifiers are compared in the same way that module modifiers are compared (see `ModuleDescriptor.compareTo`). Where the package names are equal and the set of modifiers are equal then the set of target modules are compared. This is done by sorting the names of the target modules in ascending order, and according to their natural ordering, and then comparing the corresponding elements lexicographically. Where the sets differ in size, and the larger set contains all elements of the smaller set, then the larger set is considered to succeed the smaller set.

Specified by:
  `compareTo` in interface `Comparable<ModuleDescriptor.Exports>`
Parameters:
  `that` - The module export to compare
Returns:
  A negative integer, zero, or a positive integer if this module export is less than, equal to, or greater than the given export dependence

### hashCode

public int hashCode()
Computes a hash code for this module export.

The hash code is based upon the modifiers, the package name, and for a qualified export, the set of modules names to which the package is exported. It satisfies the general contract of the `Object.hashCode` method.

Overrides:
  `hashCode` in class `Object`
Returns:
  The hash-code value for this module export
See Also:
  - `Object.equals(java.lang.Object)`
  - `System.identityHashCode(Object)`

### equals

public boolean equals(Object ob)
Tests this module export for equality with the given object.

If the given object is not an `Exports` then this method returns `false`. Two module exports objects are equal if their set of modifiers is equal, the package names are equal and the set of target module names is equal.

This method satisfies the general contract of the `Object.equals` method.

Overrides:
  `equals` in class `Object`
Parameters:
  `ob` - the object to which this object is to be compared
Returns:
  `true` if, and only if, the given object is a module dependence that is equal to this module dependence
See Also:
  - `Object.hashCode()`
  - `HashMap`

### toString

public String toString()
Returns a string describing the exported package.

Overrides:
  `toString` in class `Object`
Returns:
  A string describing the exported package