feat: add findClass method with className

This commit is contained in:
Lucaskyy 2022-03-31 23:22:14 +02:00
parent aec5eeb597
commit 78235d1abe
No known key found for this signature in database
GPG key ID: 1530BFF96D1EEB89

View file

@ -13,6 +13,12 @@ class Cache(
// if the class proxy already exists in the cached proxy list below // if the class proxy already exists in the cached proxy list below
internal val classProxy = mutableSetOf<ClassProxy>() internal val classProxy = mutableSetOf<ClassProxy>()
/**
* Find a class by a given class name
* @return A proxy for the first class that matches the class name
*/
fun findClass(className: String) = findClass { it.type.contains(className) }
/** /**
* Find a class by a given predicate * Find a class by a given predicate
* @return A proxy for the first class that matches the predicate * @return A proxy for the first class that matches the predicate