assertAreAssignableTo

fun List<ClassDeclaration>.assertAreAssignableTo(vararg superTypes: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that all class declarations extend or implement any of the specified supertypes.

Example:

classes.assertAreAssignableTo("BaseRepository", "com.example.Identifiable")

Parameters

superTypes

The allowed supertype names. At least one must match.

Throws

if any class is not assignable to any of the specified supertypes.


fun KontureScope.assertAreAssignableTo(vararg superTypes: String, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that all class declarations in the scope extend or implement any of the specified supertypes.

Parameters

superTypes

The allowed supertype names. At least one must match.

Throws

if any class is not assignable to any of the specified supertypes.


fun List<ClassDeclaration>.assertAreAssignableTo(first: KClass<*>, vararg additional: KClass<*>, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that a list of class declarations are assignable to first and additional supertypes.


fun KontureScope.assertAreAssignableTo(first: KClass<*>, vararg additional: KClass<*>, allClasses: List<ClassDeclaration> = Konture.projectGraph.getAllModules().flatMap { it.classes })

Asserts that classes in a KontureScope are assignable to first and additional supertypes.