Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save antonarhipov/1fa9af62848074fecd4b073d83f34f8c to your computer and use it in GitHub Desktop.
Save antonarhipov/1fa9af62848074fecd4b073d83f34f8c to your computer and use it in GitHub Desktop.
//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