Added new function

This commit is contained in:
2022-03-27 23:26:25 +08:00
parent c3471016db
commit 337d2c15ff
2 changed files with 12 additions and 0 deletions

View File

@@ -247,6 +247,12 @@ class ConstructorFinder(
*/ */
fun get() = Instance() fun get() = Instance()
/**
* 得到构造方法本身
* @return [Constructor] or null
*/
fun give() = memberInstance as? Constructor<*>?
/** /**
* 获得 [Constructor] 实例处理类 * 获得 [Constructor] 实例处理类
* *

View File

@@ -271,6 +271,12 @@ class MethodFinder(
*/ */
fun get(instance: Any? = null) = Instance(instance) fun get(instance: Any? = null) = Instance(instance)
/**
* 得到方法本身
* @return [Method] or null
*/
fun give() = memberInstance as? Method?
/** /**
* 获得 [Method] 实例处理类 * 获得 [Method] 实例处理类
* *