https://github.com/those-otter-programs/functional_interface_bean_mapper
Sampling the use of functional interfaces to create bean mappers.
https://github.com/those-otter-programs/functional_interface_bean_mapper
functional-interfaces functional-programming h2-database integration-tests java-21 lombok maven spring-boot-3
Last synced: 9 months ago
JSON representation
Sampling the use of functional interfaces to create bean mappers.
- Host: GitHub
- URL: https://github.com/those-otter-programs/functional_interface_bean_mapper
- Owner: Those-Otter-Programs
- License: apache-2.0
- Created: 2025-03-03T00:48:32.000Z (9 months ago)
- Default Branch: dev
- Last Pushed: 2025-03-03T01:52:52.000Z (9 months ago)
- Last Synced: 2025-03-03T02:26:20.779Z (9 months ago)
- Topics: functional-interfaces, functional-programming, h2-database, integration-tests, java-21, lombok, maven, spring-boot-3
- Language: Java
- Homepage:
- Size: 440 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Functional Interface Bean Mapper
[](https://travis-ci.org/joemccann/dillinger)
[Project repository](https://github.com/Those-Otter-Programs/functional_interface_bean_mapper)
## Description:
Sampling the use of functional interfaces to create a bean mapper.
## Features:
- The project implements a mapper called [MemberMapper](https://github.com/Those-Otter-Programs/functional_interface_bean_mapper/blob/dev/src/main/java/com/thoseop/mapper/MemberMapper.java) which is a Functional Interface with two lambda expressions, one to map MemberEntity to MemberResponse and the other way for the second. The [MemberService](https://github.com/Those-Otter-Programs/functional_interface_bean_mapper/blob/dev/src/main/java/com/thoseop/service/MemberService.java) exemplifies how to make use of it.
## Controllers
- [MemberController](#membercontroller)
---
## H2:
```bash
http://localhost:8080/h2
```
## MemberController
This controller implements 2 actions:
```bash
[GET] /member{id}
[GET] /members
```
***ROUTES:***
**/member/{id}**
```bash
# JSON response:
curl -s -L -X GET 'http://localhost:8080/member/1' | jq
```
**/members** - paginated route
```bash
# 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
```
---
## Author: James Mallon
- [github](https://github.com/jamesmallon)
- [linkedin](https://www.linkedin.com/in/roccojamesmallon/)
## License
[Apache 2.0](LICENSE)
---

---
> "It's your reaction to adversity, not adversity itself that determines how your life's story will develop." – Dieter F. Uchtdorf.