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
ConstructorsConstructorDescriptionUniversalDirective(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.Directivedelegate()Returns the delegate to which operations are delegated.final booleanfinal UniversalElementfinal List<? extends UniversalElement> getKind()final UniversalElementfinal UniversalElementfinal List<? extends UniversalElement> final inthashCode()final booleanisStatic()final booleanstatic final List<? extends UniversalDirective> of(Collection<? extends ModuleElement.Directive> es, Domain domain) Returns a non-null, immutableListofUniversalDirectives whose elements wrap the suppliedList's elements.static final UniversalDirectiveof(ModuleElement.Directive d, Domain domain) Returns aUniversalDirectivethat is either the suppliedModuleElement.Directive(if it itself isnullor is aUniversalDirective) or one that wraps it.final StringtoString()static final <T extends ModuleElement.Directive>
Tunwrap(T t) Unwraps the suppliedModuleElement.Directiveimplementation such that the returned value is not an instance ofUniversalDirective.
-
Constructor Details
-
UniversalDirective
Creates a newUniversalDirective.- Parameters:
delegate- aModuleElement.Directiveto which operations will be delegated; must not benulldomain- aDomainfrom which the supplieddelegateis presumed to have originated; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceModuleElement.Directive
-
delegate
Returns the delegate to which operations are delegated.- Returns:
- a non-
nulldelegate - See Also:
-
equals
-
getDependency
- Specified by:
getDependencyin interfaceModuleElement.RequiresDirective
-
getImplementations
- Specified by:
getImplementationsin interfaceModuleElement.ProvidesDirective
-
getKind
- Specified by:
getKindin interfaceModuleElement.Directive
-
getPackage
- Specified by:
getPackagein interfaceModuleElement.ExportsDirective- Specified by:
getPackagein interfaceModuleElement.OpensDirective
-
getService
- Specified by:
getServicein interfaceModuleElement.ProvidesDirective- Specified by:
getServicein interfaceModuleElement.UsesDirective
-
getTargetModules
- Specified by:
getTargetModulesin interfaceModuleElement.ExportsDirective- Specified by:
getTargetModulesin interfaceModuleElement.OpensDirective
-
hashCode
-
isStatic
- Specified by:
isStaticin interfaceModuleElement.RequiresDirective
-
isTransitive
- Specified by:
isTransitivein interfaceModuleElement.RequiresDirective
-
toString
-
of
Returns aUniversalDirectivethat is either the suppliedModuleElement.Directive(if it itself isnullor is aUniversalDirective) or one that wraps it.- Parameters:
d- anModuleElement.Directive; may benullin which casenullwill be returneddomain- aDomain; must not benull- Returns:
- a
UniversalDirective, ornull(ifeisnull) - Throws:
NullPointerException- ifdomainisnull- See Also:
-
of
public static final List<? extends UniversalDirective> of(Collection<? extends ModuleElement.Directive> es, Domain domain) Returns a non-null, immutableListofUniversalDirectives whose elements wrap the suppliedList's elements.- Parameters:
es- aCollectionofModuleElement.Directives; must not benulldomain- aDomain; must not benull- Returns:
- a non-
null, immutableListofUniversalDirectives - Throws:
NullPointerException- if either argument isnull
-
unwrap
Unwraps the suppliedModuleElement.Directiveimplementation such that the returned value is not an instance ofUniversalDirective.- Type Parameters:
T- aModuleElement.Directivesubtype- 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:
-