0
스칼라에서 BeanProperty에 사용할 내 자신의 setter를 어떻게 정의 할 수 있습니까?스칼라 BeanProperty는 사용자 정의 setter를 사용합니다.
class Person {
@BeanProperty var name = ""
def name_= (newName: String): Unit = {
name = newName.toLowerCase
}
}
내가 이와 같이하면, 컴파일러는 BeanProperty와 다른 코드로 작성된 충돌하는 두 세트 터를 보여줍니다.