소개
소개글이 비어있어요
게시글
고민있어요
2023.01.19 19:22
내가 산 강의를 어디서 모아볼 수 있는지 모르겠습니다..
- 0
- 1
- 292
질문&답변
2021.05.15
apply 표준함수 체이닝
return UserResponse(). apply { this . result = Result(). apply { this . resultCode = "OK" this . resultMessage = "성공" } //-- this . description = "!!!" val users = mutableListOf () users.add(userRequest) users.add(UserRequest(). apply { this . name = "a" this . age = 10 this . email = "a@a.com" this . address = "a address" this . phoneNumber = "01012341234" } ) users.add(UserRequest(). apply { this . name = "b" this . age = 10 this . email = "b@b.com" this . address = "b address" this . phoneNumber = "01012341234" } ) this . userRequest = users } 이렇게 해도 되지 않느냐는 말씀이신가요? 테스트 해봤는데 정상 작동하네요. 이해를 돕기 위해 JSON계층과 똑같은 계층으로 메세지를 채워나간 것 아닌가 추측해봅니다.
- 0
- 1
- 86