{"id":15965215,"url":"https://github.com/driver733/mapstruct-fluent","last_synced_at":"2025-05-07T06:20:46.452Z","repository":{"id":54456162,"uuid":"270643208","full_name":"driver733/mapstruct-fluent","owner":"driver733","description":"Fluent extension functions for mapstruct mappers","archived":false,"fork":false,"pushed_at":"2021-02-16T19:05:50.000Z","size":134,"stargazers_count":2,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T07:11:11.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/driver733.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-08T11:30:48.000Z","updated_at":"2022-03-30T19:36:05.000Z","dependencies_parsed_at":"2022-08-13T16:10:51.553Z","dependency_job_id":null,"html_url":"https://github.com/driver733/mapstruct-fluent","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driver733%2Fmapstruct-fluent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driver733%2Fmapstruct-fluent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driver733%2Fmapstruct-fluent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driver733%2Fmapstruct-fluent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/driver733","download_url":"https://codeload.github.com/driver733/mapstruct-fluent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252824945,"owners_count":21809865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T17:40:26.742Z","updated_at":"2025-05-07T06:20:46.432Z","avatar_url":"https://github.com/driver733.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mapstruct fluent extensions generator\n\n[![Build](https://github.com/driver733/mapstruct-fluent/workflows/Build/badge.svg?branch=master)](https://github.com/driver733/mapstruct-fluent/actions?query=workflow%3ABuild+branch%3Amaster)\n[![Maven Central](https://img.shields.io/maven-central/v/com.driver733.mapstruct-fluent/processor)](https://search.maven.org/search?q=com.driver733.mapstruct)\n\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/driver733/mapstruct-fluent/actions?query=workflow%3ARelease)\n\n[![Licence](https://img.shields.io/github/license/driver733/mapstruct-fluent)](https://github.com/driver733/mapstruct-fluent/blob/master/LICENSE)\n\nThis project provides a generator of [fluent](https://en.wikipedia.org/wiki/Fluent_interface) [extension functions](https://kotlinlang.org/docs/reference/extensions.html) for [mapstruct](https://github.com/mapstruct/mapstruct) [mappers](https://mapstruct.org/documentation/dev/reference/html/#defining-mapper).\n\n### Examples\n\n#### [Extension method for the mappers' factory](examples/example/src/test/kotlin/com/driver733/mapstructfluent/EmployeeMapperTest.kt)\n\n```kotlin\ndata class EmployeeModel(val firstName: String? = null)\ndata class EmployeeView(val firstName: String? = null)\n```\n\n```kotlin\n@Mapper\nabstract class EmployeeMapper {\n    abstract fun toEmployeeView(employeeModel: EmployeeModel): EmployeeView\n}\n```\n\n```kotlin\nval employee = EmployeeView(\"Alex\")\nemployee.toEmployeeView() == Mappers.getMapper(EmployeeMapper::class.java).toEmployeeView(employee)\n```\n\n#### [Extension method for the mapper's Spring bean](examples/example-spring/src/test/kotlin/com/driver733/mapstructfluent/EmployeeMapperTest.kt)\n\n```kotlin\ndata class EmployeeModel(val firstName: String? = null)\ndata class EmployeeView(val firstName: String? = null)\n```\n```kotlin\n@Mapper(componentmodel = \"spring\")\nabstract class EmployeeMapper {\n    abstract fun toEmployeeView(employeeModel: EmployeeModel): EmployeeView\n}\n```\n\nCalling the generated extension function\n```kotlin\n@Service\nclass Service {\n    fun a() {\n        val model = EmployeeModel(\"Alex\")\n        val view = employee.toEmployeeView()\n    }\n}\n```\n\nis the same as manually using the mapper's Spring bean\n```kotlin\n@Service\nclass Service(\n    private val mapper: EmployeeMapper\n) {\n    fun a() {\n        val model = EmployeeModel(\"Alex\")\n        val view = mapper.toEmployeeView(employee)\n    }\n}\n```\n\n\n## Distribution\n\nThis project is [available](https://search.maven.org/search?q=com.driver733.mapstruct-fluent) on the Maven Central repository.\n\n## Getting Started\n\n### Install\n\n#### Gradle\n\n##### Groovy DSL\n\nAdd this to your project's `build.gradle`:\n\n```groovy\ndependencies {\n    annotationProcessor 'com.driver733.mapstruct-fluent:processor:1.0.3'\n    implementation 'com.driver733.mapstruct-fluent:processor:1.0.3'\n    annotationProcessor 'com.driver733.mapstruct-fluent:processor-spring:1.0.3'\n    implementation 'com.driver733.mapstruct-fluent:processor-spring:1.0.3'\n}\n```\n\n##### Kotlin DSL\n\n1. Apply the [`KAPT` plugin](https://plugins.gradle.org/plugin/org.jetbrains.kotlin.kapt).\n\n    ```kotlin\n    plugins {\n      id(\"org.jetbrains.kotlin.kapt\") version \"1.3.72\"\n    }\n    ```\n2. Add this to your project's `build.gradle.kts`:\n\n    ```kotlin\n    dependencies {\n        kapt(\"com.driver733.mapstruct-fluent:processor:1.0.3\")\n        implementation(\"com.driver733.mapstruct-fluent:processor:1.0.3\")\n        kapt(\"com.driver733.mapstruct-fluent:processor-spring:1.0.3\")\n        implementation(\"com.driver733.mapstruct-fluent:processor-spring:1.0.3\")\n    }\n    ``` \n\n#### Maven\n\nAdd this to your project's `pom.xml`:\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.driver733.mapstruct-fluent\u003c/groupId\u003e\n      \u003cartifactId\u003eprocessor\u003c/artifactId\u003e\n      \u003cversion\u003e1.0.3\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.driver733.mapstruct-fluent\u003c/groupId\u003e\n      \u003cartifactId\u003eprocessor-spring\u003c/artifactId\u003e\n      \u003cversion\u003e1.0.3\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n\u003cpluginManagement\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n            \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e...\u003c/version\u003e\n            \u003cconfiguration\u003e\n                \u003cannotationProcessorPaths\u003e\n                    \u003cannotationProcessorPath\u003e\n                        \u003cgroupId\u003ecom.driver733.mapstruct-fluent\u003c/groupId\u003e\n                        \u003cartifactId\u003eprocessor\u003c/artifactId\u003e\n                        \u003cversion\u003e1.0.3\u003c/version\u003e\n                    \u003c/annotationProcessorPath\u003e\n                   \u003cannotationProcessorPath\u003e\n                        \u003cgroupId\u003ecom.driver733.mapstruct-fluent\u003c/groupId\u003e\n                        \u003cartifactId\u003eprocessor-spring\u003c/artifactId\u003e\n                        \u003cversion\u003e1.0.3\u003c/version\u003e\n                    \u003c/annotationProcessorPath\u003e\n                \u003c/annotationProcessorPaths\u003e\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/pluginManagement\u003e\n```\n\n## Development\n\n### Prerequisites\n\n[JDK](https://stackoverflow.com/a/52524114/2441104), preferably \u003e= `v. 1.8`\n\n### Build\n\n```\n./gradlew clean build\n```\n\n### CI/CD\n\n[Github actions](https://github.com/driver733/mapstruct-fluent/actions) is used for CI/CD.\n\n### Releases\n\nReleases to the Maven Central repository are [automatically](https://github.com/driver733/mapstruct-fluent/actions?query=workflow%3ARelease)\nmade on each commit on the master branch with the help of the [semantic-release](https://github.com/semantic-release/semantic-release).\n\n## Contributing\n\n1. Create an issue and describe your problem/suggestion in it.\n2. Submit a pull request with a reference to the issue that the pull request closes.\n3. I will review your changes and merge them.\n4. A new version with your changes will be released automatically right after merging.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/driver733/mapstruct-fluent/tags). \n\n## Authors\n\n* **Mikhail [@driver733](https://www.driver733.com) Yakushin** - *Initial work*\n\nSee also the list of [contributors](https://github.com/driver733/mapstruct-fluent/graphs/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/driver733/mapstruct-fluent/blob/master/LICENSE) file for details.\n\n## Acknowledgments\n\n* [semantic-release](https://github.com/semantic-release/semantic-release)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriver733%2Fmapstruct-fluent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdriver733%2Fmapstruct-fluent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriver733%2Fmapstruct-fluent/lists"}