### Java Person Class Example Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/java.md A sample Java class demonstrating the conventional getter method for a private field. ```java class Person { private String name; public String getName() { return name; } } ``` -------------------------------- ### Generate Object Mapper with Mappie Source: https://github.com/mr-mappie/mappie/blob/main/README.md Create an object mapper by extending `ObjectMappie` and defining the mapping logic within the `mapping` block. This example shows how to map properties and combine fields. ```kotlin object PersonToPersonDtoMapper : ObjectMappie() { override fun map(from: Person) = mapping { to::name fromValue "${from.name} ${from.surname}" } } ``` -------------------------------- ### Configure Mappie Plugin in Maven Source: https://github.com/mr-mappie/mappie/blob/main/README.md Configure the `kotlin-maven-plugin` to include Mappie as a compiler plugin and add the `mappie-maven-plugin` as a dependency. Replace '...' with appropriate versions and configurations. ```xml org.jetbrains.kotlin kotlin-maven-plugin ... mappie ... tech.mappie mappie-maven-plugin version ``` -------------------------------- ### Apply Mappie Gradle Plugin Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/gradle.md Add the Mappie plugin to your Gradle build file to enable its functionality. This is the primary step for integrating Mappie. ```kotlin plugins { id("tech.mappie.plugin") version "version" } ``` ```groovy plugins { id "tech.mappie.plugin" version "version" } ``` -------------------------------- ### Apply Mappie Plugin in Gradle Source: https://github.com/mr-mappie/mappie/blob/main/README.md Integrate Mappie into your Gradle project by applying the `tech.mappie.plugin`. Ensure you replace 'version' with the actual plugin version. ```kotlin plugins { id("tech.mappie.plugin") version "version" } ``` -------------------------------- ### Configure Mappie Gradle Settings Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/gradle.md Customize Mappie's behavior through Gradle configuration. These settings control aspects like default argument usage, strictness rules, and reporting. ```kotlin mappie { useDefaultArguments = false // Disable using default arguments in implicit mappings strictness { enums = false // Do not report an error if not all enum sources are mapped platformTypeNullability = true // Enable strict nullability checks for platform types in mappings visibility = true // Allow calling constructors not visible from the calling scope } reporting { enabled = true // Enable report generation } } ``` -------------------------------- ### Configure Mappie Plugin Options Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/maven.md Set Mappie's behavior using plugin options within the kotlin-maven-plugin configuration. These options control aspects like default argument usage, enum mapping strictness, and platform type nullability. ```xml ``` -------------------------------- ### Enable Lenient Naming Convention (Gradle) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Globally enable lenient property name matching, normalizing names to lowercase and removing separators, by configuring the Gradle build file. ```kotlin mappie { namingConvention = NamingConvention.LENIENT // Enable lenient property name matching } ``` -------------------------------- ### Enable Constructor Visibility (Gradle) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Globally allow Mappie to call constructors not visible from the calling scope by configuring the Gradle build file. ```kotlin mappie { strictness { visibility = true // Allow calling constructors not visible from the calling scope } } ``` -------------------------------- ### Create Object Mapper for Implicit Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/implicit.md Instantiate an ObjectMappie for the source and target types. Mappie will automatically infer the mapping logic based on matching properties. ```kotlin object PersonMapper : ObjectMappie() ``` -------------------------------- ### Mapping Multiple Sources to a DTO Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/multiple-sources.md Use ObjectMappie3 (or up to ObjectMappie5) to map multiple source objects to a single DTO. Define the mapping logic within the `map` function. ```kotlin object PersonDtoMapper : ObjectMappie3() { override fun map(first: Person, second: Address, third: ContactInformation): PersonDto = mapping { // mapping logic } } ``` -------------------------------- ### Create Enum Mapper with EnumMappie Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/overview.md Implement an enum mapper by extending EnumMappie. Mappie automatically resolves mappings between enums with identical entry names. ```kotlin object ColorMapper : EnumMappie() ``` -------------------------------- ### Map a List of Objects with mapList Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/collections.md Use the `mapList` function to automatically map a List of objects from one type to another. Ensure the target mapper is defined. ```kotlin object PersonMapper : ObjectMappie() val persons: List = listOf(Person("Sjon"), Person("Piet")) val personDtos: List = PersonMapper.mapList(persons) ``` -------------------------------- ### Map Target Property via Source Property Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Use `fromProperty` to map a target property to a specific source property. This is useful when the source property name or type differs. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { PersonDto::description fromProperty from::name } } ``` -------------------------------- ### Simplified Book to BookDto Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/collections.md When Mappie can infer the mapping for collection elements, the explicit use of `IterableToListMapper` can be omitted. This simplified version relies on Mappie's default behavior to map the `pages` list. ```kotlin object BookMapper : ObjectMappie() { override fun map(from: Book): BookDto = mapping { BookDto::pages fromProperty Book::pages } } ``` -------------------------------- ### Map Target Property via Source Property (NotNull Assertion) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Use `fromPropertyNotNull` as a concise alternative to `fromProperty` with a `transform { it!! }` for non-nullable targets from nullable sources. ```kotlin to::x fromPropertyNotNull from::y ``` -------------------------------- ### Default Book to BookDto Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/collections.md In cases where Mappie can automatically determine the mapping for all properties, including collections, an explicit mapper definition might be entirely unnecessary. This demonstrates the most concise form where Mappie handles the entire mapping. ```kotlin object BookMapper : ObjectMappie() ``` -------------------------------- ### Define Reusable Conversions in Interface Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/local-conversions.md Define common conversion methods in an interface to be implemented by multiple mappers for reusability. ```kotlin interface CommonConverters { fun unwrap(wrapper: StringWrapper): String = wrapper.value fun unwrapInt(wrapper: IntWrapper): Int = wrapper.value } object PersonMapper : ObjectMappie(), CommonConverters { override fun map(from: Person) = mapping() } object EmployeeMapper : ObjectMappie(), CommonConverters { override fun map(from: Employee) = mapping() } ``` -------------------------------- ### Map Object using Mappie in Kotlin Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/introduction.md Demonstrates how to use the generated `PersonMapper` to map a `Person` object to a `PersonDto` object. This utilizes Mappie's `map` function for single object transformation. ```kotlin val personDto = PersonMapper.map(Person("Sjon", 58, Gender.MALE)) ``` -------------------------------- ### Map Property using 'to' Alias Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Uses the `to` alias to refer to target properties, providing a more concise way to map properties compared to direct property access. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { to::streetname fromProperty from.address::street } } ``` -------------------------------- ### Define Source and Target Enums Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/inheritance.md Define the source and target enums for mapping. Ensure 'Other' is included if it represents a common case. ```kotlin enum class Gender { Male, Female, Other } enum class EyeColor { Blue, Green, Other } ``` ```kotlin enum class GenderDto { MALE, FEMALE, OTHER } enum class EyeColorDto { BLUE, GREEN, OTHER } ``` -------------------------------- ### Map Page Text to String Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/collections.md Define a simple mapper to extract a specific property from a source object to be used within a collection mapping. This mapper is used to convert a `Page` object to a `String` by taking its `text` property. ```kotlin object PageMapper : ObjectMappie() { override fun map(from: Page): String = from.text } ``` -------------------------------- ### Define Data Classes for Implicit Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/implicit.md Define source and target data classes with matching property names and types for implicit mapping. No explicit configuration is needed if properties are directly assignable. ```kotlin data class Person(val name: String, val age: Int) data class PersonDto(val name: String, val age: Int) ``` -------------------------------- ### Configure Kotlin Maven Plugin with Mappie Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/maven.md Add the Mappie compiler plugin to your kotlin-maven-plugin configuration. Ensure you have the correct version for both the plugin and the Mappie API dependency. ```xml org.jetbrains.kotlin kotlin-maven-plugin ... mappie ... tech.mappie mappie-maven-plugin version ``` -------------------------------- ### Map Target Property via Fixed Value Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Use `fromValue` to assign a constant, predefined value to a target property. This is useful for setting default or static information. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { PersonDto::description fromValue "unknown" } } ``` -------------------------------- ### Define Data Classes for Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/local-conversions.md Define the data classes involved in the mapping process. ```kotlin data class StringWrapper(val value: String) data class Person(val name: StringWrapper) data class PersonDto(val name: String) ``` -------------------------------- ### Create Class Mapper for Implicit Enum Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/implicit.md Create a class-based mapper for the main data classes. Mappie will automatically generate the nested mapper for the enum types. ```kotlin class PersonMapper : ObjectMappie() ``` -------------------------------- ### Map Enum Entries Using fromEnumEntry Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/entry-mapping.md Create a mapper that explicitly maps a specific source enum entry to a target enum entry. This is useful when enums have different entries. ```kotlin object ColorMapper : EnumMappie() { override fun map(from: Color): Colour = mapping { Colour.OTHER fromEnumEntry Color.ORANGE } } ``` -------------------------------- ### Enable Lenient Naming Convention (Annotation) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Enable lenient property name matching for a specific mapper by applying the `@UseNamingConvention` annotation. ```kotlin import tech.mappie.api.config.UseNamingConvention import tech.mappie.api.config.NamingConvention @UseNamingConvention(NamingConvention.LENIENT) object PersonMapper : ObjectMappie() ``` -------------------------------- ### Map to PersonDto using Primary Constructor Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Explicitly maps to the primary constructor of `PersonDto` by providing its parameter types as type arguments to `mapping`. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person) = mapping(::PersonDto) } ``` -------------------------------- ### Define Enum Classes with Different Entries Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/entry-mapping.md Define two enum classes, `Color` and `Colour`, where `Color` has an extra entry `ORANGE` and `Colour` has an `OTHER` entry instead. ```kotlin enum class Color { RED, GREEN, BLUE, ORANGE; } enum class Colour { RED, GREEN, BLUE, OTHER; } ``` -------------------------------- ### Abstract Uppercase Enum Mapper Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/inheritance.md Create an abstract base mapper that capitalizes enum names for reuse. This mapper requires the target enum entries to be passed in the constructor. ```kotlin abstract class UppercaseEnumMapper, TO : Enum>( private val entries: EnumEntries ) : EnumMappie() { override fun map(from: FROM) = entries.first { it.name == from.name.uppercase() } } ``` -------------------------------- ### Define Data Classes for Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/via.md Define the source and target data classes involved in the mapping process. Ensure all properties that need to be mapped are declared. ```kotlin data class Person( val name: String, val address: Address, ) data class Address( val street: String, ) data class PersonDto( val name: String, val addressDto: AddressDto, ) data class AddressDto( val street: String, ) ``` -------------------------------- ### Define Enum Classes for Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/overview.md Define the source and target enum classes. Ensure enum entries have identical names for automatic mapping. ```kotlin enum class Color { RED, GREEN, BLUE; } enum class Colour { RED, GREEN, BLUE; } ``` -------------------------------- ### Add Mappie API Dependency Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/gradle.md Include the mappie-api dependency in your project if you are using Mappie versions below 1.0.0 or need to add it manually. This provides the necessary runtime components. ```kotlin dependencies { implementation("tech.mappie:mappie-api:version") } ``` ```groovy dependencies { implementation "tech.mappie:mappie-api:version" } ``` -------------------------------- ### Map Non-Referenceable Constructor Parameter Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Use `to("parameterName")` to map to constructor parameters that do not have a corresponding public property or setter. This requires referencing the parameter by its name as a string. ```kotlin data class PersonDto( val name: String, val age: Int, description: String, ) object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { to("description") fromValue "a constant" } } ``` -------------------------------- ### Map to PersonDto using Secondary Constructor Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Explicitly maps to the secondary constructor of `PersonDto` by providing its parameter types as type arguments to `mapping`. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person) = mapping(::PersonDto) } ``` -------------------------------- ### Define Data Classes for Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Define the source and target data classes for object mapping. Ensure all properties intended for mapping are declared. ```kotlin data class Person( val name: String, val age: Int, ) data class PersonDto( val name: String, val age: Int, val description: String, ) ``` -------------------------------- ### Define PersonDto with Primary and Secondary Constructors Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Defines a data class `PersonDto` with a primary constructor and an additional secondary constructor. ```kotlin data class PersonDto( val name: String, val age: Int, val description: String, ) { constructor(name: String, age: Int) : this(name, age, "description") } ``` -------------------------------- ### Define Data Classes and Mappers in Kotlin Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/getting-started/posts/introduction.md Defines data classes for `Person` and `PersonDto`, along with their respective `Gender` and `GenderDto` enums. It also shows how to create a `PersonMapper` using Mappie's `ObjectMappie` and `EnumMappie` for compile-time object mapping. ```kotlin data class Person( val firstname: String, val age: Int, val gender: Gender, ) enum class Gender { MALE, FEMALE, NON_BINARY, OTHER } data class PersonDto( val name: String, val age: Int, val gender: GenderDto, ) enum class GenderDto { MALE, FEMALE, OTHER } object PersonMapper : ObjectMappie() { override fun map(from: Person) = mapping { to::name fromProperty from::firstname } private object GenderMapper : EnumMappie() { override fun map(from: Gender) = mapping { GenderDto.OTHER fromEnumEntry Gender.NON_BINARY } } } ``` -------------------------------- ### Define Local Conversion Method in Mapper Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/local-conversions.md Define a local conversion method directly within the mapper class to handle type conversion. ```kotlin object PersonMapper : ObjectMappie() { fun unwrap(wrapper: StringWrapper): String = wrapper.value override fun map(from: Person) = mapping() } ``` -------------------------------- ### Map Target Property via Expression Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/explicit.md Use `fromExpression` to map a target property using a lambda that can access the source object. This provides flexibility for computed values. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { PersonDto::description fromExpression { from -> "Description: ${from.name}" } } } ``` -------------------------------- ### Add Mappie API Dependency in Maven Source: https://github.com/mr-mappie/mappie/blob/main/README.md Include the `mappie-api-jvm` dependency in your Maven project for JVM targets. Replace 'version' with the specific version required. ```xml tech.mappie mappie-api-jvm version ``` -------------------------------- ### Define Data Classes for Mapping Source: https://github.com/mr-mappie/mappie/blob/main/README.md Define the source and target data classes for object mapping. These classes represent the structures between which Mappie will generate mapping code. ```kotlin data class Person( val name: String, val surname: String, val age: Int, ) data class PersonDto( val name: String, val age: Int, ) ``` -------------------------------- ### Define Data Class with Default Argument Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/implicit.md Define a target data class with a property that has a default argument. Mappie will use this default value if no explicit mapping is provided for that property. ```kotlin data class PersonDto( val name: String, val age: Int, val hasChildren: Boolean = false, ) ``` -------------------------------- ### Disable Default Arguments (Gradle) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Globally disable the use of default arguments in implicit mappings by configuring the Gradle build file. ```kotlin mappie { useDefaultArguments = false // Disable using default arguments in implicit mappings } ``` -------------------------------- ### Reuse Mapper with Via Operator Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/via.md Construct a mapper for the main objects (Person to PersonDto) and explicitly reuse the AddressMapper for the nested address property using the 'via' operator. ```kotlin object PersonMapper : ObjectMappie() { override fun map(from: Person) = mapping { to::addressDto fromProperty from::address via AddressMapper } } ``` -------------------------------- ### Define Generic Local Conversion Method Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/local-conversions.md Define a generic local conversion method within a mapper class to handle conversions for various types. ```kotlin data class Input(val items: List) data class Output(val items: Set) object Mapper : ObjectMappie() { fun toSet(list: List): Set = list.toSet() override fun map(from: Input) = mapping() } ``` -------------------------------- ### Map Enum Entries to Throw Exception Using thrownByEnumEntry Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/entry-mapping.md Configure a mapper to throw an exception when a specific source enum entry is encountered. This provides fine-grained control over error handling during mapping. ```kotlin object ColorMapper : EnumMappie() { override fun map(from: Color): Colour = mapping { IllegalStateException() thrownByEnumEntry Color.ORANGE } } ``` -------------------------------- ### Define Data Classes with Enums for Implicit Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/implicit.md Define source and target data classes that include enum types. Mappie can automatically generate mappings for enums if they contain the same entries. ```kotlin data class Person(val name: String, val gender: Gender) enum class Gender { MALE, FEMALE, OTHER; } data class PersonDto(val name: String, val gender: GenderDto) enum class GenderDto { MALE, FEMALE, OTHER; } ``` -------------------------------- ### Map Book to BookDto using IterableToListMapper Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/collections.md Map a `Book` object to a `BookDto` by leveraging the `IterableToListMapper`. This built-in mapper handles the transformation of the `pages` list, using the provided `PageMapper` for individual element conversion. ```kotlin object BookMapper : ObjectMappie() { override fun map(from: Book): BookDto = mapping { BookDto::pages fromProperty Book::pages via IterableToListMapper(PageMapper) } } ``` -------------------------------- ### Define a Reusable Mapper Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/via.md Create a mapper for a nested object, such as Address to AddressDto. This mapper can then be reused in other mappings. ```kotlin object AddressMapper : ObjectMappie() ``` -------------------------------- ### Concrete Enum Mappers Re-using Base Mapper Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/inheritance.md Define concrete mappers that inherit from the abstract base mapper, providing the specific target enum entries. This allows for code reuse across different enum types. ```kotlin object GenderMapper : UppercaseEnumMapper(GenderDto.entries) ``` ```kotlin object EyeColorMapper : UppercaseEnumMapper(EyeColorDto.entries) ``` -------------------------------- ### Transforming Date to Age Period Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/transforming.md Use the transform operator to convert a source date of birth into an age period for the target object. Ensure necessary date and time classes are imported. ```kotlin data class Person(val name: String, val dateOfBirth: LocalDate) data class PersonDto( val name: String, val age: DateTimePeriod, ) object PersonMapper : ObjectMappie() { override fun map(from: Person): PersonDto = mapping { PersonDto::age fromProperty Person::dateOfBirth transform { Clock.todayIn(TimeZone.currentSystemDefault()).periodUntil(dateOfBirth) } } } ``` -------------------------------- ### Disable Java Nullability Validation (Gradle) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Globally disable strict validation for Java platform types assigned to non-nullable targets by configuring the Gradle build file. ```kotlin mappie { strictness { platformTypeNullability = false // Allow unsafe assigning Java platform types to non-nullable targets } } ``` -------------------------------- ### Override to Strict Naming Convention (Annotation) Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/configuration.md Override a global lenient naming convention to strict mode for a specific mapper using the `@UseNamingConvention` annotation. ```kotlin @UseNamingConvention(NamingConvention.STRICT) object StrictMapper : ObjectMappie() ``` -------------------------------- ### Handling Nullable to Non-Nullable Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/transforming.md Employ the transform operator to provide a default value when mapping a nullable source property to a non-nullable target property. This prevents null pointer exceptions. ```kotlin data class Dog(val name: String?) data class DogDto(val name: String) object DogMapper : ObjectMappie() { override fun map(from: Dog): DogDto = mapping { DogDto::name fromProperty Dog::name transform { it ?: "unknown" } } } ``` -------------------------------- ### Kotlin PersonDto Data Class Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/java.md A Kotlin data class that serves as the target for mapping from a Java object. ```kotlin data class PersonDto(val name: String) ``` -------------------------------- ### Exclude Method from Automatic Mapping Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/object-mapping/posts/local-conversions.md Use the @ExcludeFromMapping annotation to prevent a method from being used for automatic type conversion. ```kotlin import tech.mappie.api.config.ExcludeFromMapping object PersonMapper : ObjectMappie() { @ExcludeFromMapping fun validateWrapper(wrapper: StringWrapper): String { require(wrapper.value.isNotBlank()) return wrapper.value } override fun map(from: Person) = mapping { PersonDto::name fromProperty Person::name transform { it.value } } } ``` -------------------------------- ### Disable Global Enum Strictness in Gradle Source: https://github.com/mr-mappie/mappie/blob/main/website/src/posts/enum-mapping/posts/configuration.md Configure the Gradle build file to disable strict enum mapping globally. This prevents errors if not all enum sources are mapped, but may lead to runtime exceptions. ```kotlin mappie { strictness { enums = false // Do not report an error if not all enum sources are mapped } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.