Last active
November 17, 2019 16:34
-
-
Save mezentsev/db3785d0a4fc8af1f70198364ae68b65 to your computer and use it in GitHub Desktop.
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
object Lib { | |
private val instance: LibInternal by lazy { | |
LibInternal() | |
} | |
fun init(buider: Builder) = instance.init(builder) | |
internal class LibInternal : Lib { | |
private var inited: Boolean | |
@Synchronized | |
override fun init(builder: Builder) { | |
if (inited) throw IllegalStateException("Already inited") | |
inited = true | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment