Class ClassFiles

java.lang.Object
org.springframework.core.test.tools.ClassFiles
All Implemented Interfaces:
Iterable<ClassFile>

public final class ClassFiles extends Object implements Iterable<ClassFile>
An immutable collection of ClassFile instances.
Since:
6.0
Author:
Stephane Nicoll
  • Method Details

    • none

      public static ClassFiles none()
      Return a ClassFiles instance with no items.
      Returns:
      the empty instance
    • of

      public static ClassFiles of(ClassFile... ClassFiles)
      Factory method that can be used to create a ClassFiles instance containing the specified classes.
      Parameters:
      ClassFiles - the classes to include
      Returns:
      a ClassFiles instance
    • and

      public ClassFiles and(ClassFile... classFiles)
      Return a new ClassFiles instance that merges classes from another array of ClassFile instances.
      Parameters:
      classFiles - the instances to merge
      Returns:
      a new ClassFiles instance containing merged content
    • and

      public ClassFiles and(Iterable<ClassFile> classFiles)
      Return a new ClassFiles instance that merges classes from another iterable of ClassFiles instances.
      Parameters:
      classFiles - the instances to merge
      Returns:
      a new ClassFiles instance containing merged content
    • iterator

      public Iterator<ClassFile> iterator()
      Specified by:
      iterator in interface Iterable<ClassFile>
    • stream

      public Stream<ClassFile> stream()
      Stream the ClassFile instances contained in this collection.
      Returns:
      a stream of classes
    • isEmpty

      public boolean isEmpty()
      Returns true if this collection is empty.
      Returns:
      if this collection is empty
    • get

      @Nullable public ClassFile get(String name)
      Get the ClassFile with the given class name.
      Parameters:
      name - the fully qualified name to find
      Returns:
      a ClassFile instance or null
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object