Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def getOwnerName(systemId: String): Option[String] = {
val systemOption: Option[System] = systemsMap.get(systemId)
val ownerOption: Option[Owner] = systemOption.flatMap(system => ownersMap.get(system.ownerId))
ownerOption.map(owner => owner.name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment