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) booleancontains(com.tngtech.archunit.core.domain.JavaClass type) Returns whether theApplicationModule.AllowedDependencycontains the givenJavaClass.(package private) booleanReturns whether theApplicationModule.AllowedDependencycontains the givenClass.booleanReturns the target module of the dependency.Returns theNamedInterfacedeclared as valid target.inthashCode()(package private) static ApplicationModule.AllowedDependenciesof(ApplicationModule source, String expression, ApplicationModules modules) CreatesApplicationModule.AllowedDependencyinstances to the module and optionally named interface defined by the given expression.(package private) booleanrefersTo(ApplicationModule module) Returns whether theApplicationModule.AllowedDependencyrefers to the givenApplicationModule.(package private) static ApplicationModule.AllowedDependencyto(ApplicationModule module) Creates a newApplicationModule.AllowedDependencyto the unnamed interface of the givenApplicationModule.toString()
-
Method Details
-
of
static ApplicationModule.AllowedDependencies of(ApplicationModule source, String expression, ApplicationModules modules) CreatesApplicationModule.AllowedDependencyinstances to the module and optionally named interface defined by the given expression. The wildcard variants are expanded into the individual named interfaces they stand for.- Parameters:
source- the source module of the dependency, must not be null.expression- must not be null or empty. Follows the${moduleName}(::${namedInterfaceName})pattern, where the interface name can be*to refer to all explicitly declared named interfaces or**to additionally include the unnamed interface, i.e. the module's base package.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.- See Also:
-
to
Creates a newApplicationModule.AllowedDependencyto 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 theNamedInterfacedeclared as valid target.- Returns:
- will never be null.
-
refersTo
Returns whether theApplicationModule.AllowedDependencyrefers to the givenApplicationModule.- Parameters:
module- must not be null.- Since:
- 2.2
-
contains
boolean contains(com.tngtech.archunit.core.domain.JavaClass type) Returns whether theApplicationModule.AllowedDependencycontains the givenJavaClass.- Parameters:
type- must not be null.- Returns:
-
contains
Returns whether theApplicationModule.AllowedDependencycontains the givenClass.- Parameters:
type- must not be null.- Returns:
-
toString
-
equals
-
hashCode
public int hashCode()
-