diff --git a/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt b/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt index ff0f162..9391dbb 100644 --- a/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt +++ b/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt @@ -8,12 +8,12 @@ import org.springframework.context.annotation.Bean @AutoConfiguration open class KediatRAutoConfiguration { @Bean - open fun kediatRSpringBeanProvider(applicationContext: ApplicationContext): KediatRSpringBeanProvider { - return KediatRSpringBeanProvider(applicationContext) - } + open fun kediatRSpringBeanProvider( + applicationContext: ApplicationContext + ): KediatRSpringBeanProvider = KediatRSpringBeanProvider(applicationContext) @Bean - open fun mediator(kediatRSpringBeanProvider: KediatRSpringBeanProvider): Mediator { - return MediatorBuilder(kediatRSpringBeanProvider).build() - } + open fun mediator( + kediatRSpringBeanProvider: KediatRSpringBeanProvider + ): Mediator = MediatorBuilder(kediatRSpringBeanProvider).build() } diff --git a/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt b/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt index 601d5c4..e7068e7 100644 --- a/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt +++ b/projects/kediatr-spring-boot-2x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt @@ -8,12 +8,11 @@ import org.springframework.context.ApplicationContext class KediatRSpringBeanProvider( private val applicationContext: ApplicationContext ) : DependencyProvider { - override fun getSingleInstanceOf(clazz: Class): T { - return applicationContext.getBean(clazz) - } + override fun getSingleInstanceOf(clazz: Class): T = applicationContext.getBean(clazz) - override fun getSubTypesOf(clazz: Class): Collection> { - return applicationContext.getBeanNamesForType(clazz) - .map { applicationContext.getType(it) as Class } - } + override fun getSubTypesOf( + clazz: Class + ): Collection> = applicationContext + .getBeanNamesForType(clazz) + .map { applicationContext.getType(it) as Class } } diff --git a/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt b/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt index ff0f162..9391dbb 100644 --- a/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt +++ b/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRAutoConfiguration.kt @@ -8,12 +8,12 @@ import org.springframework.context.annotation.Bean @AutoConfiguration open class KediatRAutoConfiguration { @Bean - open fun kediatRSpringBeanProvider(applicationContext: ApplicationContext): KediatRSpringBeanProvider { - return KediatRSpringBeanProvider(applicationContext) - } + open fun kediatRSpringBeanProvider( + applicationContext: ApplicationContext + ): KediatRSpringBeanProvider = KediatRSpringBeanProvider(applicationContext) @Bean - open fun mediator(kediatRSpringBeanProvider: KediatRSpringBeanProvider): Mediator { - return MediatorBuilder(kediatRSpringBeanProvider).build() - } + open fun mediator( + kediatRSpringBeanProvider: KediatRSpringBeanProvider + ): Mediator = MediatorBuilder(kediatRSpringBeanProvider).build() } diff --git a/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt b/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt index 601d5c4..e7068e7 100644 --- a/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt +++ b/projects/kediatr-spring-boot-3x-starter/src/main/kotlin/com/trendyol/kediatr/spring/KediatRSpringBeanProvider.kt @@ -8,12 +8,11 @@ import org.springframework.context.ApplicationContext class KediatRSpringBeanProvider( private val applicationContext: ApplicationContext ) : DependencyProvider { - override fun getSingleInstanceOf(clazz: Class): T { - return applicationContext.getBean(clazz) - } + override fun getSingleInstanceOf(clazz: Class): T = applicationContext.getBean(clazz) - override fun getSubTypesOf(clazz: Class): Collection> { - return applicationContext.getBeanNamesForType(clazz) - .map { applicationContext.getType(it) as Class } - } + override fun getSubTypesOf( + clazz: Class + ): Collection> = applicationContext + .getBeanNamesForType(clazz) + .map { applicationContext.getType(it) as Class } }