From 95a19c114afa9f19ad3fae902efab7eecb724ae0 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Sat, 2 Jun 2018 00:43:22 +0200 Subject: Style fixes --- .../main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt | 12 ++++++------ src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kvision-server/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt b/kvision-server/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt index 50ef770f..0ff01d04 100644 --- a/kvision-server/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt +++ b/kvision-server/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt @@ -54,7 +54,7 @@ actual open class ServiceManager actual constructor(val service: T) { noinline function: T.(Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { @@ -89,7 +89,7 @@ actual open class ServiceManager actual constructor(val service: T) { noinline function: T.(PAR, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { @@ -129,7 +129,7 @@ actual open class ServiceManager actual constructor(val service: T) { noinline function: T.(PAR1, PAR2, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { @@ -170,7 +170,7 @@ actual open class ServiceManager actual constructor(val service: T) { noinline function: T.(PAR1, PAR2, PAR3, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { @@ -212,7 +212,7 @@ actual open class ServiceManager actual constructor(val service: T) { noinline function: T.(PAR1, PAR2, PAR3, PAR4, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { @@ -259,7 +259,7 @@ actual open class ServiceManager actual constructor(val service: T) { method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" routes.add({ call(method, "$prefix$routeDef") { req, res -> if (service != null) { diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt b/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt index 9101539f..0b2bba23 100644 --- a/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt +++ b/src/main/kotlin/pl/treksoft/kvision/remote/ServiceManager.kt @@ -41,7 +41,7 @@ actual open class ServiceManager actual constructor(service: T) { noinline function: T.(Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } @@ -56,7 +56,7 @@ actual open class ServiceManager actual constructor(service: T) { noinline function: T.(PAR, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } @@ -71,7 +71,7 @@ actual open class ServiceManager actual constructor(service: T) { noinline function: T.(PAR1, PAR2, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } @@ -86,7 +86,7 @@ actual open class ServiceManager actual constructor(service: T) { noinline function: T.(PAR1, PAR2, PAR3, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } @@ -101,7 +101,7 @@ actual open class ServiceManager actual constructor(service: T) { noinline function: T.(PAR1, PAR2, PAR3, PAR4, Request?) -> Deferred, route: String?, method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } @@ -119,7 +119,7 @@ actual open class ServiceManager actual constructor(service: T) { method: RpcHttpMethod, prefix: String ) { - val routeDef = if (route != null) route else "route${this::class.simpleName}${counter++}" + val routeDef = route ?: "route${this::class.simpleName}${counter++}" calls[function.toString()] = Pair("$prefix$routeDef", method) } -- cgit