RichUtils / pyxis.uzuki.live.richutilskt.utils / RConstructorBuilder

RConstructorBuilder

class RConstructorBuilder<T>

Class for generate Instance of given Class object

Usages:

  1. Constructor hasn't any parameter val sampleClassObj = RConstructorBuilder(SampleClass::class.java).newInstance()
  2. Constructor has at least one parameter val sampleClass2Obj = RConstructorBuilder(SampleClass2::class.java) .addParameter(String::class.java, "ABC") .addParameter(Int::class, 20) .newInstance()

Constructors

<init>

RConstructorBuilder(targetCls: Class<T>)

Class for generate Instance of given Class object

Functions

addParameter

fun addParameter(cls: Class<*>, value: Any?): RConstructorBuilder<T>
fun addParameter(cls: KClass<*>, value: Any?): RConstructorBuilder<T>

newInstance

fun newInstance(map: Map<Class<*>, Any?> = mMap): T