Interface BuildingBlockDescriptor

    • Method Detail

      • isBuildingBlock

        boolean isBuildingBlock​(com.tngtech.archunit.core.domain.JavaClass javaClass)
        Evaluates if the given JavaClass is a BuildingBlock of the type which is returned by type().
        Parameters:
        javaClass - The JavaClass to be evaluated
        Returns:
        true, if the given JavaClass is a BuildingBlock of type type(), otherwise false.
      • forSimpleNameEndingWith

        static BuildingBlockDescriptor forSimpleNameEndingWith​(BuildingBlockType buildingBlockType,
                                                               String suffix)
        Convenient method to create a new descriptor matching all java classes whose simple name ends with a given suffix. The suffix matching is case sensitive.
        Parameters:
        buildingBlockType - The type of the BuildingBlock the new descriptor should describe. Must not be null.
        suffix - The suffix the matching java classes should end with. Must not be null.
        Returns:
        A new descriptor.
      • forAssignableTo

        static BuildingBlockDescriptor forAssignableTo​(BuildingBlockType buildingBlockType,
                                                       Class<?>... types)
        Convenient method to create a new descriptor matching all java classes that are assignable to at least one of the given types.
        Parameters:
        buildingBlockType - The type of the BuildingBlock the new descriptor should describe. Must not be null.
        types - The types the matching java classes should be assignable to. At least one type must be assignable in order to match. Must not be null.
        Returns:
        A new descriptor.
      • forAnnotatedWith

        static BuildingBlockDescriptor forAnnotatedWith​(BuildingBlockType buildingBlockType,
                                                        Class<? extends Annotation> type)
        Convenient method to create a new descriptor matching all java classes that are annotated with the given annotation.
        Parameters:
        buildingBlockType - The type of the BuildingBlock the new descriptor should describe. Must not be null.
        type - The annotation with which the matching java classes should be annotated. Must not be null.
        Returns:
        A new descriptor.
      • forMetaAnnotatedWith

        static BuildingBlockDescriptor forMetaAnnotatedWith​(BuildingBlockType buildingBlockType,
                                                            Class<? extends Annotation> type)
        Convenient method to create a new descriptor matching all java classes that are meta-annotated with the given annotation. That means the class is either directly annotated with the given annotation or is annotated with an annotation which itself is annotated with the original annotation.
        Parameters:
        buildingBlockType - The type of the BuildingBlock the new descriptor should describe. Must not be null.
        type - The annotation with which the matching java classes should be meta-annotated. Must not be null.
        Returns:
        A new descriptor.