Class SourceFiles
java.lang.Object
org.springframework.aot.test.generate.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 newSourceFiles
instance that merges files from another array ofSourceFile
instances.and
(SourceFile... sourceFiles) Return a newSourceFiles
instance that merges files from another array ofSourceFile
instances.and
(SourceFiles sourceFiles) Return a newSourceFiles
instance that merges files from anotherSourceFiles
instance.boolean
Get theSourceFile
with the given 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.int
hashCode()
boolean
isEmpty()
Returnstrue
if this collection is empty.iterator()
static SourceFiles
none()
Return aSourceFiles
instance with no items.static SourceFiles
of
(SourceFile... sourceFiles) Factory method that can be used to create aSourceFiles
instance containing the specified files.stream()
Stream theSourceFile
instances contained in this collection.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
none
Return aSourceFiles
instance with no items.- Returns:
- the empty instance
-
of
Factory method that can be used to create aSourceFiles
instance containing the specified files.- Parameters:
sourceFiles
- the files to include- Returns:
- a
SourceFiles
instance
-
and
Return a newSourceFiles
instance that merges files from another array ofSourceFile
instances.- Parameters:
sourceFiles
- the instances to merge- Returns:
- a new
SourceFiles
instance containing merged content
-
and
Return a newSourceFiles
instance that merges files from another array ofSourceFile
instances.- Parameters:
sourceFiles
- the instances to merge- Returns:
- a new
SourceFiles
instance containing merged content
-
and
Return a newSourceFiles
instance that merges files from anotherSourceFiles
instance.- Parameters:
sourceFiles
- the instance to merge- Returns:
- a new
SourceFiles
instance containing merged content
-
iterator
- Specified by:
iterator
in interfaceIterable<SourceFile>
-
stream
Stream theSourceFile
instances contained in this collection.- Returns:
- a stream of file instances
-
isEmpty
public boolean isEmpty()Returnstrue
if this collection is empty.- Returns:
- if this collection is empty
-
get
Get theSourceFile
with the given path.- Parameters:
path
- the path to find- Returns:
- a
SourceFile
instance 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
-