inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

Hoon님의 게시글

Hoon Hoon

@leejihun10241395

수강평 작성수
-
평균평점
-

게시글 2

질문&답변

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
조회수
189