Class SourceFiles
java.lang.Object
org.springframework.aot.test.generator.file.SourceFiles
- All Implemented Interfaces:
Iterable<SourceFile>
An immutable collection of
SourceFile instances.- Since:
- 6.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionand(Iterable<SourceFile> sourceFiles) Return a newSourceFilesinstance that merges files from another array ofSourceFileinstances.and(SourceFile... sourceFiles) Return a newSourceFilesinstance that merges files from another array ofSourceFileinstances.and(SourceFiles sourceFiles) Return a newSourceFilesinstance that merges files from anotherSourceFilesinstance.booleanGet theSourceFilewith the givenDynamicFile#getPath() path.Return the single source file contained in the collection.Return the single matching source file contained in the collection.getSingleFromPackage(String packageName) Return a single source file contained in the specified package.inthashCode()booleanisEmpty()Returnstrueif this collection is empty.iterator()static SourceFilesnone()Return aSourceFilesinstance with no items.static SourceFilesof(SourceFile... sourceFiles) Factory method that can be used to create aSourceFilesinstance containing the specified files.stream()Stream theSourceFileinstances contained in this collection.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
none
Return aSourceFilesinstance with no items.- Returns:
- the empty instance
-
of
Factory method that can be used to create aSourceFilesinstance containing the specified files.- Parameters:
sourceFiles- the files to include- Returns:
- a
SourceFilesinstance
-
and
Return a newSourceFilesinstance that merges files from another array ofSourceFileinstances.- Parameters:
sourceFiles- the instances to merge- Returns:
- a new
SourceFilesinstance containing merged content
-
and
Return a newSourceFilesinstance that merges files from another array ofSourceFileinstances.- Parameters:
sourceFiles- the instances to merge- Returns:
- a new
SourceFilesinstance containing merged content
-
and
Return a newSourceFilesinstance that merges files from anotherSourceFilesinstance.- Parameters:
sourceFiles- the instance to merge- Returns:
- a new
SourceFilesinstance containing merged content
-
iterator
- Specified by:
iteratorin interfaceIterable<SourceFile>
-
stream
Stream theSourceFileinstances contained in this collection.- Returns:
- a stream of file instances
-
isEmpty
public boolean isEmpty()Returnstrueif this collection is empty.- Returns:
- if this collection is empty
-
get
Get theSourceFilewith the givenDynamicFile#getPath() path.- Parameters:
path- the path to find- Returns:
- a
SourceFileinstance ornull
-
getSingle
Return the single source file contained in the collection.- Returns:
- the single file
- Throws:
IllegalStateException- if the collection doesn't contain exactly one file
-
getSingle
Return the single matching source file contained in the collection.- Returns:
- the single file
- Throws:
IllegalStateException- if the collection doesn't contain exactly one file
-
getSingleFromPackage
Return a single source file contained in the specified package.- Returns:
- the single file
- Throws:
IllegalStateException- if the collection doesn't contain exactly one file
-
equals
-
hashCode
public int hashCode() -
toString
-