Skip to content

Documentation/tests for Java records support #204

Description

@ErwinOlieAlliander

It looks like mappie supports mapping from Java record types, but it isn't documented and neither protected by testcases.

public record JavaClass(String value) { }
import tech.mappie.api.ObjectMappie

data class KotlinClass(val value: String)

object Mapper : ObjectMappie<JavaClass, KotlinClass>() {
    override fun map(from: JavaClass) = mapping {
        to::value fromValue from.value!!
    }
}

fun main() {
    println(Mapper.map(JavaClass("value")).value)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions