Class UniversalDirective
java.lang.Object
org.microbean.construct.element.UniversalDirective
- All Implemented Interfaces:
ModuleElement.Directive
,ModuleElement.ExportsDirective
,ModuleElement.OpensDirective
,ModuleElement.ProvidesDirective
,ModuleElement.RequiresDirective
,ModuleElement.UsesDirective
public final class UniversalDirective
extends Object
implements ModuleElement.ExportsDirective, ModuleElement.OpensDirective, ModuleElement.ProvidesDirective, ModuleElement.RequiresDirective, ModuleElement.UsesDirective
A
ModuleElement.Directive
implementation.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorDescriptionUniversalDirective
(ModuleElement.Directive delegate, Domain domain) Creates a newUniversalDirective
. -
Method Summary
Modifier and TypeMethodDescriptionfinal <R,
P> R accept
(ModuleElement.DirectiveVisitor<R, P> v, P p) final ModuleElement.Directive
delegate()
Returns the delegate to which operations are delegated.final boolean
final UniversalElement
final List
<? extends UniversalElement> getKind()
final UniversalElement
final UniversalElement
final List
<? extends UniversalElement> final int
hashCode()
final boolean
isStatic()
final boolean
static final List
<? extends UniversalDirective> of
(Collection<? extends ModuleElement.Directive> es, Domain domain) Returns a non-null
, immutableList
ofUniversalDirective
s whose elements wrap the suppliedList
's elements.static final UniversalDirective
of
(ModuleElement.Directive d, Domain domain) Returns aUniversalDirective
that is either the suppliedModuleElement.Directive
(if it itself isnull
or is aUniversalDirective
) or one that wraps it.final String
toString()
static final <T extends ModuleElement.Directive>
Tunwrap
(T t) Unwraps the suppliedModuleElement.Directive
implementation such that the returned value is not an instance ofUniversalDirective
.
-
Constructor Details
-
UniversalDirective
Creates a newUniversalDirective
.- Parameters:
delegate
- aModuleElement.Directive
to which operations will be delegated; must not benull
domain
- aDomain
from which the supplieddelegate
is presumed to have originated; must not benull
- Throws:
NullPointerException
- if either argument isnull
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceModuleElement.Directive
-
delegate
Returns the delegate to which operations are delegated.- Returns:
- a non-
null
delegate - See Also:
-
equals
-
getDependency
- Specified by:
getDependency
in interfaceModuleElement.RequiresDirective
-
getImplementations
- Specified by:
getImplementations
in interfaceModuleElement.ProvidesDirective
-
getKind
- Specified by:
getKind
in interfaceModuleElement.Directive
-
getPackage
- Specified by:
getPackage
in interfaceModuleElement.ExportsDirective
- Specified by:
getPackage
in interfaceModuleElement.OpensDirective
-
getService
- Specified by:
getService
in interfaceModuleElement.ProvidesDirective
- Specified by:
getService
in interfaceModuleElement.UsesDirective
-
getTargetModules
- Specified by:
getTargetModules
in interfaceModuleElement.ExportsDirective
- Specified by:
getTargetModules
in interfaceModuleElement.OpensDirective
-
hashCode
-
isStatic
- Specified by:
isStatic
in interfaceModuleElement.RequiresDirective
-
isTransitive
- Specified by:
isTransitive
in interfaceModuleElement.RequiresDirective
-
toString
-
of
Returns aUniversalDirective
that is either the suppliedModuleElement.Directive
(if it itself isnull
or is aUniversalDirective
) or one that wraps it.- Parameters:
d
- anModuleElement.Directive
; may benull
in which casenull
will be returneddomain
- aDomain
; must not benull
- Returns:
- a
UniversalDirective
, ornull
(ife
isnull
) - Throws:
NullPointerException
- ifdomain
isnull
- See Also:
-
of
public static final List<? extends UniversalDirective> of(Collection<? extends ModuleElement.Directive> es, Domain domain) Returns a non-null
, immutableList
ofUniversalDirective
s whose elements wrap the suppliedList
's elements.- Parameters:
es
- aCollection
ofModuleElement.Directive
s; must not benull
domain
- aDomain
; must not benull
- Returns:
- a non-
null
, immutableList
ofUniversalDirective
s - Throws:
NullPointerException
- if either argument isnull
-
unwrap
Unwraps the suppliedModuleElement.Directive
implementation such that the returned value is not an instance ofUniversalDirective
.- Type Parameters:
T
- aModuleElement.Directive
subtype- Parameters:
t
- aModuleElement.Directive
; may benull
- Returns:
- an object of the appropriate type that is guaranteed not to be an instance of
UniversalDirective
- See Also:
-