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.(package private) static NamedInterfaces
discoverNamedInterfaces
(JavaPackage basePackage) Discovers allNamedInterfaces
declared for the givenJavaPackage
.Returns theNamedInterface
with the given name if present.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.
-
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.
-
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.
-