Class NamedInterfaces
java.lang.Object
org.springframework.modulith.core.NamedInterfaces
- All Implemented Interfaces:
Iterable<NamedInterface>
A collection of
NamedInterface
s.- Author:
- Oliver Drotbohm
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) NamedInterfaces
and
(Iterable<NamedInterface> others) Creates a newNamedInterfaces
instance with the givenNamedInterface
s added.boolean
containsInExplicitInterface
(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the given type is contained in one of the explicitly namedNamedInterface
s.(package private) boolean
containsInExplicitInterface
(Class<?> type) (package private) static NamedInterfaces
discoverNamedInterfaces
(JavaPackage basePackage) Discovers allNamedInterfaces
declared for the givenJavaPackage
.(package private) static NamedInterfaces
forOpen
(JavaPackage basePackage) Creates a newNamedInterface
consisting of the unnamed one containing all classes in the givenJavaPackage
.Returns theNamedInterface
with the given name if present.getNamedInterfacesContaining
(com.tngtech.archunit.core.domain.JavaClass type) Returns all named interfaces that contain the given type.(package private) Stream<NamedInterface>
getNamedInterfacesContaining
(Class<?> type) Returns the unnamedNamedInterface
of the module.boolean
Returns whether at least one explicitNamedInterface
is declared.iterator()
(package private) static NamedInterfaces
of
(List<NamedInterface> interfaces) Creates a newNamedInterfaces
for the givenNamedInterface
s.(package private) static NamedInterfaces
ofAnnotatedPackages
(JavaPackage basePackage) Creates a newNamedInterfaces
for the given baseJavaPackage
.stream()
Create aStream
ofNamedInterface
s.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
NONE
-
-
Method Details
-
discoverNamedInterfaces
Discovers allNamedInterfaces
declared for the givenJavaPackage
.- Parameters:
basePackage
- must not be null.- Returns:
- will never be null.
-
of
Creates a newNamedInterfaces
for the givenNamedInterface
s.- Parameters:
interfaces
- must not be null.- Returns:
- will never be null.
-
ofAnnotatedPackages
Creates a newNamedInterfaces
for the given baseJavaPackage
.- Parameters:
basePackage
- must not be null.- Returns:
- will never be null.
-
forOpen
Creates a newNamedInterface
consisting of the unnamed one containing all classes in the givenJavaPackage
.- Parameters:
basePackage
- must not be null.- Returns:
- will never be null.
- Since:
- 1.2
-
hasExplicitInterfaces
public boolean hasExplicitInterfaces()Returns whether at least one explicitNamedInterface
is declared.- Returns:
- will never be null.
-
stream
Create aStream
ofNamedInterface
s.- Returns:
- will never be null.
-
getByName
Returns theNamedInterface
with the given name if present.- Parameters:
name
- must not be null or empty.- Returns:
- will never be null.
-
getUnnamedInterface
Returns the unnamedNamedInterface
of the module.- Returns:
- will never be null.
-
getNamedInterfacesContaining
public Stream<NamedInterface> getNamedInterfacesContaining(com.tngtech.archunit.core.domain.JavaClass type) Returns all named interfaces that contain the given type.- Parameters:
type
- must not be null.- Returns:
- will never be null.
-
containsInExplicitInterface
public boolean containsInExplicitInterface(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the given type is contained in one of the explicitly namedNamedInterface
s.- Parameters:
type
- must not be null.- Since:
- 1.2
-
iterator
- Specified by:
iterator
in interfaceIterable<NamedInterface>
-
and
Creates a newNamedInterfaces
instance with the givenNamedInterface
s added.- Parameters:
others
- must not be null.- Returns:
- will never be null.
-
getNamedInterfacesContaining
-
containsInExplicitInterface
-