Created
February 28, 2020 12:22
-
-
Save antonarhipov/1fa9af62848074fecd4b073d83f34f8c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//lazy singleton | |
object Singleton { | |
class Something | |
val INSTANCE by lazy { Something() } | |
} | |
// filtering positive integers | |
val positiveNumbers = integers.filter { it > 0 } | |
/* | |
Create a POJO with getters, setters, `equals()`, `hashCode()`, `toString()` and `copy()` in a single line: | |
*/ | |
data class Customer(val name: String, val email: String, val company: String) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment