Sampling the use of functional interfaces to create a bean mapper.
- The project implements a mapper called MemberMapper which is a Functional Interface with two lambda expressions, one to map MemberEntity to MemberResponse and the other way for the second. The MemberService exemplifies how to make use of it.
http://localhost:8080/h2
This controller implements 2 actions:
[GET] /member{id}
[GET] /members
ROUTES:
/member/{id}
# JSON response:
curl -s -L -X GET 'http://localhost:8080/member/1' | jq
/members - paginated route
# JSON response:
curl -s -L -X GET 'http://localhost:8080/members?page=0&size=8&sort=asc' | jq
curl -s -L -X GET 'http://localhost:8080/members?page=0&size=8' | jq
curl -s -L -X GET 'http://localhost:8080/members?page=0' | jq
curl -s -L -X GET 'http://localhost:8080/members' | jq
"It's your reaction to adversity, not adversity itself that determines how your life's story will develop." – Dieter F. Uchtdorf.