Class Classes

java.lang.Object
org.springframework.modulith.core.Classes
All Implemented Interfaces:
com.tngtech.archunit.base.DescribedIterable<com.tngtech.archunit.core.domain.JavaClass>, com.tngtech.archunit.base.HasDescription, Iterable<com.tngtech.archunit.core.domain.JavaClass>

class Classes extends Object implements com.tngtech.archunit.base.DescribedIterable<com.tngtech.archunit.core.domain.JavaClass>
First-class value for a set of JavaClass instances.
Author:
Oliver Drotbohm
  • Field Details

    • NONE

      public static Classes NONE
  • Method Details

    • of

      static Classes of(com.tngtech.archunit.core.domain.JavaClasses classes)
      Creates a new Classes for the given JavaClasses.
      Parameters:
      classes - must not be null.
      Returns:
    • of

      static Classes of(List<com.tngtech.archunit.core.domain.JavaClass> classes)
      Creates a new Classes for the given JavaClasses.
      Parameters:
      classes - must not be null.
      Returns:
      will never be null.
    • toClasses

      static Collector<com.tngtech.archunit.core.domain.JavaClass,?,Classes> toClasses()
      Returns a Collector creating a Classes instance from a Stream of JavaType.
      Returns:
      will never be null.
    • that

      Classes that(Predicate<? super com.tngtech.archunit.core.domain.JavaClass> predicate)
      Returns Classes that match the given Predicate.
      Parameters:
      predicate - must not be null.
      Returns:
    • thatResideIn

      Classes thatResideIn(PackageName name, boolean nested)
      Returns all classes that reside the given PackageName.
      Parameters:
      name - must not be null.
      nested - whether to include nested packages
      Returns:
      will never be null.
    • and

      Classes and(Classes classes)
    • and

      Classes and(Collection<com.tngtech.archunit.core.domain.JavaClass> others)
      Returns a Classes with the current elements and the given other ones combined.
      Parameters:
      others - must not be null.
      Returns:
    • stream

      public Stream<com.tngtech.archunit.core.domain.JavaClass> stream()
    • isEmpty

      boolean isEmpty()
    • toOptional

      Optional<com.tngtech.archunit.core.domain.JavaClass> toOptional()
    • contains

      boolean contains(com.tngtech.archunit.core.domain.JavaClass type)
    • contains

      boolean contains(Class<?> type)
    • contains

      boolean contains(String className)
    • getRequiredClass

      com.tngtech.archunit.core.domain.JavaClass getRequiredClass(Class<?> type)
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface com.tngtech.archunit.base.HasDescription
    • iterator

      public Iterator<com.tngtech.archunit.core.domain.JavaClass> iterator()
      Specified by:
      iterator in interface Iterable<com.tngtech.archunit.core.domain.JavaClass>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

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

      String format()
    • format

      String format(String basePackage)
    • format

      static String format(com.tngtech.archunit.core.domain.JavaClass type, String basePackage)
    • format

      static String format(com.tngtech.archunit.core.domain.JavaClass type, String basePackage, boolean exposed)
      Formats the given JavaClass into a String, potentially abbreviating the given base package.
      Parameters:
      type - must not be null.
      basePackage - must not be null.
      exposed - whether the given type is considered exposed or not.
      Returns:
      will never be null.