Class NamedInterfaces
java.lang.Object
org.springframework.modulith.core.NamedInterfaces
- All Implemented Interfaces:
Iterable<NamedInterface>
A collection of
NamedInterfaces.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder API to manually constructNamedInterfacesinstances. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionand(Iterable<NamedInterface> others) Creates a newNamedInterfacesinstance with the givenNamedInterfaces added.static NamedInterfaces.Builderbuilder(JavaPackage basePackage) Creates a newNamedInterfaces.Builderto eventually createNamedInterfacesfor the given base package.booleancontainsInExplicitInterface(com.tngtech.archunit.core.domain.JavaClass type) Returns whether the given type is contained in one of the explicitly namedNamedInterfaces.(package private) booleancontainsInExplicitInterface(Class<?> type) static NamedInterfacesdiscoverNamedInterfaces(JavaPackage basePackage) Discovers allNamedInterfacesdeclared for the givenJavaPackage.static NamedInterfacesforOpen(JavaPackage basePackage) Creates a newNamedInterfaceconsisting of the unnamed one containing all classes in the givenJavaPackage.Returns theNamedInterfacewith 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 unnamedNamedInterfaceof the module.booleanReturns whether at least one explicitNamedInterfaceis declared.iterator()(package private) static NamedInterfacesof(List<NamedInterface> interfaces) Creates a newNamedInterfacesfor the givenNamedInterfaces.static NamedInterfacesof(JavaPackage basePackage, ApplicationModuleInformation information) (package private) static NamedInterfacesofAnnotatedPackages(JavaPackage basePackage) Creates a newNamedInterfacesfor the given baseJavaPackage.stream()Create aStreamofNamedInterfaces.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
NONE
-
-
Method Details
-
of
- Parameters:
basePackage- must not be null.information- must not be null.- Returns:
- Since:
- 1.4
-
discoverNamedInterfaces
Discovers allNamedInterfacesdeclared for the givenJavaPackage.- Parameters:
basePackage- must not be null.- Returns:
- will never be null.
- Since:
- 1.4 (previously package protected)
-
builder
Creates a newNamedInterfaces.Builderto eventually createNamedInterfacesfor the given base package.- Parameters:
basePackage- must not be null.- Returns:
- will never be null.
-
of
Creates a newNamedInterfacesfor the givenNamedInterfaces.- Parameters:
interfaces- must not be null.- Returns:
- will never be null.
-
ofAnnotatedPackages
Creates a newNamedInterfacesfor the given baseJavaPackage.- Parameters:
basePackage- must not be null.- Returns:
- will never be null.
-
forOpen
Creates a newNamedInterfaceconsisting of the unnamed one containing all classes in the givenJavaPackage.- Parameters:
basePackage- must not be null.- Returns:
- will never be null.
- Since:
- 1.2, public since 1.4
-
hasExplicitInterfaces
public boolean hasExplicitInterfaces()Returns whether at least one explicitNamedInterfaceis declared.- Returns:
- will never be null.
-
stream
Create aStreamofNamedInterfaces.- Returns:
- will never be null.
-
getByName
Returns theNamedInterfacewith the given name if present.- Parameters:
name- must not be null or empty.- Returns:
- will never be null.
-
getUnnamedInterface
Returns the unnamedNamedInterfaceof 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 namedNamedInterfaces.- Parameters:
type- must not be null.- Since:
- 1.2
-
iterator
- Specified by:
iteratorin interfaceIterable<NamedInterface>
-
and
Creates a newNamedInterfacesinstance with the givenNamedInterfaces added.- Parameters:
others- must not be null.- Returns:
- will never be null.
- Since:
- 1.4 (previously package protected)
-
getNamedInterfacesContaining
-
containsInExplicitInterface
-
toString
-