Module java.base
Package java.lang.module

## Class ModuleDescriptor.Exports

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

Enclosing class:
  ModuleDescriptor

    public static final class ModuleDescriptor.Exports
    extends Object

A module export, may be qualified or unqualified.

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

### Method Summary

All Methods Instance Methods Concrete Methods
`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.
`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 module export.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### 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

#### hashCode

    public int hashCode()

Computes a hash code for this module export.

The hash code is based upon 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(java.lang.Object)`

#### equals

    public boolean equals(Object ob)

Tests this module export for equality with the given object.

If the given object is not a `Exports` then this method returns `false`. Two module exports objects are equal if 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 module export.

Overrides:
  `toString` in class `Object`
Returns:
  A string describing module export