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.@Nullable NamedInterfaceReturns theNamedInterfacedeclared as valid target if declared.inthashCode()(package private) static ApplicationModule.AllowedDependencyof(String identifier, ApplicationModule source, ApplicationModules modules) Creates anApplicationModule.AllowedDependencyto the module and optionally named interface defined by the given identifier.(package private) static ApplicationModule.AllowedDependencyto(ApplicationModule module) Creates a newApplicationModule.AllowedDependencyto the unnamed interface of the givenApplicationModule.toString()
-
Method Details
-
of
static ApplicationModule.AllowedDependency of(String identifier, ApplicationModule source, ApplicationModules modules) Creates anApplicationModule.AllowedDependencyto 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.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 if declared.- Returns:
- can be null.
-
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()
-