Simplify Kotlin objects.

This commit is contained in:
Chris Rankin 2017-02-01 09:30:42 +00:00
parent f9ac03287c
commit 8c478ff7cc
3 changed files with 7 additions and 32 deletions

View File

@ -5,10 +5,9 @@ import java.util.concurrent.Executors
import kotlin.reflect.jvm.jvmName
class Explorer(explorerController: ExplorerController) : AutoCloseable {
class Explorer(val explorerController: ExplorerController) : AutoCloseable {
private val log = LoggerFactory.getLogger(Explorer::class.jvmName)
private val explorerController: ExplorerController = explorerController
private val executor = Executors.newSingleThreadExecutor()
private var process: Process? = null

View File

@ -1,19 +1,11 @@
package net.corda.demobench.model
open class NetworkMapConfig(legalName: String, artemisPort: Int) {
open class NetworkMapConfig(val legalName: String, val artemisPort: Int) {
private var keyValue: String = toKey(legalName)
private var keyValue = toKey(legalName)
val key : String
get() { return keyValue }
private var legalNameValue: String = legalName
val legalName : String
get() { return legalNameValue }
private var artemisPortValue: Int = artemisPort
val artemisPort : Int
get() { return artemisPortValue }
}
private val WHITESPACE = "\\s++".toRegex()

View File

@ -9,28 +9,12 @@ import java.lang.String.join
class NodeConfig(
legalName: String,
artemisPort: Int,
nearestCity: String,
webPort: Int,
h2Port: Int,
extraServices: List<String>
val nearestCity: String,
val webPort: Int,
val h2Port: Int,
val extraServices: List<String>
) : NetworkMapConfig(legalName, artemisPort) {
private var nearestCityName: String = nearestCity
val nearestCity : String
get() { return nearestCityName }
private var webPortValue: Int = webPort
val webPort : Int
get() { return webPortValue }
private var h2PortValue: Int = h2Port
val h2Port : Int
get() { return h2PortValue }
private var extraServicesValue: List<String> = extraServices
val extraServices : List<String>
get() { return extraServicesValue }
private var networkMapValue: NetworkMapConfig? = null
var networkMap : NetworkMapConfig?
get() { return networkMapValue }