Class ApplicationModule.AllowedDependency
java.lang.Object
org.springframework.modulith.core.ApplicationModule.AllowedDependency
- Enclosing class:
- ApplicationModule
Describes a dependency explicitly declared as allowed for an
ApplicationModule
.- Since:
- 1.4.2, package private before
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescription(package private) boolean
contains
(com.tngtech.archunit.core.domain.JavaClass type) Returns whether theApplicationModule.AllowedDependency
contains the givenJavaClass
.(package private) boolean
Returns whether theApplicationModule.AllowedDependency
contains the givenClass
.boolean
Returns the target module of the dependency.Returns theNamedInterface
declared as valid target if declared.int
hashCode()
(package private) static ApplicationModule.AllowedDependency
of
(String identifier, ApplicationModule source, ApplicationModules modules) Creates anApplicationModule.AllowedDependency
to the module and optionally named interface defined by the given identifier.(package private) static ApplicationModule.AllowedDependency
to
(ApplicationModule module) Creates a newApplicationModule.AllowedDependency
to the unnamed interface of the givenApplicationModule
.toString()
-
Method Details
-
of
static ApplicationModule.AllowedDependency of(String identifier, ApplicationModule source, ApplicationModules modules) Creates anApplicationModule.AllowedDependency
to the module and optionally named interface defined by the given identifier.- Parameters:
identifier
- must not be null or empty. Follows the${moduleName}(::${namedInterfaceName})
pattern.source
- the source module of the dependency, must not be null.modules
- must not be null.- Returns:
- will never be null.
- Throws:
IllegalArgumentException
- in case the given identifier is invalid, i.e. does not refer to an existing module or named interface.
-
to
Creates a newApplicationModule.AllowedDependency
to the unnamed interface of the givenApplicationModule
.- Parameters:
module
- must not be null.- Returns:
-
getTargetModule
Returns the target module of the dependency.- Returns:
- will never be null.
-
getTargetNamedInterface
Returns theNamedInterface
declared as valid target if declared.- Returns:
- can be null.
-
contains
boolean contains(com.tngtech.archunit.core.domain.JavaClass type) Returns whether theApplicationModule.AllowedDependency
contains the givenJavaClass
.- Parameters:
type
- must not be null.- Returns:
-
contains
Returns whether theApplicationModule.AllowedDependency
contains the givenClass
.- Parameters:
type
- must not be null.- Returns:
-
toString
-
equals
-
hashCode
public int hashCode()
-