-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Konvert to Kotlin
- Loading branch information
Showing
28 changed files
with
88 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
src/main/java/com/github/kpavlov/jreactive8583/client/ClientConfiguration.java
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/main/java/com/github/kpavlov/jreactive8583/server/ServerConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions
43
src/main/kotlin/com/github/kpavlov/jreactive8583/client/ClientConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@file:JvmName("ClientConfiguration") | ||
|
||
package com.github.kpavlov.jreactive8583.client | ||
|
||
import com.github.kpavlov.jreactive8583.ConnectorConfiguration | ||
|
||
open class ClientConfiguration( | ||
builder: Builder | ||
) : ConnectorConfiguration(builder) { | ||
|
||
/** | ||
* Client reconnect interval in milliseconds. | ||
* | ||
* @return interval between reconnects, in milliseconds. | ||
*/ | ||
val reconnectInterval: Int = builder.reconnectInterval | ||
|
||
companion object { | ||
|
||
/** | ||
* Default client reconnect interval in milliseconds. | ||
*/ | ||
const val DEFAULT_RECONNECT_INTERVAL = 100 | ||
|
||
@JvmStatic | ||
fun newBuilder(): Builder = Builder() | ||
|
||
@Suppress("unused") | ||
@JvmStatic | ||
fun getDefault(): ClientConfiguration = newBuilder().build() | ||
} | ||
|
||
@Suppress("unused") | ||
data class Builder( | ||
var reconnectInterval: Int = DEFAULT_RECONNECT_INTERVAL | ||
) : ConnectorConfiguration.Builder<Builder>() { | ||
|
||
fun reconnectInterval(reconnectInterval: Int) = | ||
apply { this.reconnectInterval = reconnectInterval } | ||
|
||
fun build() = ClientConfiguration(this) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/com/github/kpavlov/jreactive8583/server/ServerConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@file:JvmName("ServerConfiguration") | ||
|
||
package com.github.kpavlov.jreactive8583.server | ||
|
||
import com.github.kpavlov.jreactive8583.ConnectorConfiguration | ||
|
||
@SuppressWarnings("WeakerAccess") | ||
class ServerConfiguration( | ||
builder: Builder | ||
) : ConnectorConfiguration(builder) { | ||
|
||
companion object { | ||
@JvmStatic | ||
fun newBuilder(): Builder = Builder() | ||
|
||
@Suppress("unused") | ||
@JvmStatic | ||
fun getDefault(): ServerConfiguration = newBuilder().build() | ||
} | ||
|
||
class Builder : ConnectorConfiguration.Builder<Builder>() { | ||
fun build() = ServerConfiguration(this) | ||
} | ||
} |