core-java icon indicating copy to clipboard operation
core-java copied to clipboard

`BoundedContextBuilder.add(entityClass: KClass<out E>)` extension function

Open alexander-yevsyukov opened this issue 1 year ago • 0 comments

The function proved to be useful when working in McJava. It just makes the Kotlin backend code more idiomatic.

The exact code to be added is this:

/**
 * Adds specified entity class to this `BoundedContextBuilder`.
 */
public inline fun <reified I, reified E : Entity<I, *>>
        BoundedContextBuilder.add(entityClass: KClass<out E>) {
    add(entityClass.java)
}

alexander-yevsyukov avatar Jan 04 '24 01:01 alexander-yevsyukov