What is idiomatic way of updating a field in an object inside a scala option? flag is a boolean field in item,and I just want to reverse its value:
val newOption = itemOption.map(item => item.copy(flag = !item.flag))
Is this correct way?
What is idiomatic way of updating a field in an object inside a scala option? flag is a boolean field in item,and I just want to reverse its value:
val newOption = itemOption.map(item => item.copy(flag = !item.flag))
Is this correct way?
Copyright © 2021 Jogjafile Inc.