FastMapper is a kotlin DSL based auto mapping library for kotlin and android applications.
- Define Mapper
val mapper = FastMapper.Builder.build {
withMapping<ModelSource, ModelTarget>()
}- Map Objects
val model = ModelSource(name = "Fastmapper")
val mappedModel: ModelTarget = mapper.map(model)FastMapper also allowed to map fields with custom coordinates.
val mapper = FastMapper.Builder.build {
withMapping<ModelSource, ModelTarget> {
ModelSource::name mapTo ModelTarget::bigname
}
}Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}dependencies {
implementation 'com.github.mukuljangir372:fastmapper:v1.0'
}