An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# Functional Interface Bean Mapper

[![Buid Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](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)

---

![Have a good one](src/main/resources/imgs/chill_otter.jpg)

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