Skip to content

Instantly share code, notes, and snippets.

@yurique
Created Aug 22, 2012
Embed
What would you like to do?
scala version
class Person(var firstName: String, var lastName: String, var address: Address) {
def this() = this(null, null, null)
}
class Address(var city: String, var street: String) {
def this() = this(null, null)
}
val persons = getAListSomewhere();
val filtered = persons.filter(_.address.city == "Kyiv")
val adresses = persons.map(_.address).toSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment