Skip to content

Commit

Permalink
feat: add withTransformer to ShapeShift builder without TransformerRe…
Browse files Browse the repository at this point in the history
…gistration
  • Loading branch information
Idane committed May 19, 2022
1 parent 409da96 commit fd70454
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@

package dev.krud.shapeshift

import dev.krud.shapeshift.transformer.base.FieldTransformer

class ShapeShiftBuilder {
private val transformers: MutableList<TransformerRegistration<*, *>> = mutableListOf()

fun withTransformer(fieldTransformer: FieldTransformer<*, *>, default: Boolean = false, name: String? = null): ShapeShiftBuilder {
transformers.add(TransformerRegistration(fieldTransformer, default, name))
return this
}

fun withTransformer(transformerRegistration: TransformerRegistration<*, *>): ShapeShiftBuilder {
transformers += transformerRegistration
return this
Expand Down

0 comments on commit fd70454

Please sign in to comment.