AutoMappingConfiguration

This is the generic interface used to configure auto-mapping functionality for message format libraries. The various methods here can be used to provide custom mapping behaviour (say for domain classes).

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.boolean(noinline inFn: (Boolean) -> OUT, noinline outFn: (OUT) -> Boolean): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
abstract fun done(): BUILDER

Finalise the mapping configurations.

Link copied to clipboard
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.double(noinline outFn: (OUT) -> Double, noinline inFn: (Double) -> OUT): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.duration(noinline inFn: (Duration) -> OUT, noinline outFn: (OUT) -> Duration): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.instant(noinline inFn: (Instant) -> OUT, noinline outFn: (OUT) -> Instant): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.int(noinline inFn: (Int) -> OUT, noinline outFn: (OUT) -> Int): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.localDate(noinline inFn: (LocalDate) -> OUT, noinline outFn: (OUT) -> LocalDate): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.localTime(noinline inFn: (LocalTime) -> OUT, noinline outFn: (OUT) -> LocalTime): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.long(noinline inFn: (Long) -> OUT, noinline outFn: (OUT) -> Long): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Prevent the unmarshalling of raw (unbounded) strings. Useful when we are taking data from the Internet and want to ensure that all inbound fields are represented by bounded or validated types.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "textSerialize")
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.text(noinline mapping: (OUT) -> String): AutoMappingConfiguration<BUILDER>

Utility method for when only writing/serialization is required

@JvmName(name = "textDeserialize")
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.text(noinline mapping: (String) -> OUT): AutoMappingConfiguration<BUILDER>

Utility method for when only reading/deserialization is required

inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.text(noinline inFn: (String) -> OUT, noinline outFn: (OUT) -> String): AutoMappingConfiguration<BUILDER>

This is the set of utility methods which avoid the noise of creating a BiDiMapping when specifying mappings.

Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.uri(noinline inFn: (Uri) -> OUT, noinline outFn: (OUT) -> Uri): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.uuid(noinline inFn: (UUID) -> OUT, noinline outFn: (OUT) -> UUID): AutoMappingConfiguration<BUILDER>
Link copied to clipboard
@JvmName(name = "stringMapper")
inline fun <BUILD, VALUE : Value<T>, T : Any> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, T>): AutoMappingConfiguration<BUILD>
@JvmName(name = "bigDecimal")
inline fun <BUILD, VALUE : Value<BigDecimal>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, BigDecimal>): AutoMappingConfiguration<BUILD>
@JvmName(name = "bigIntegerMapper")
inline fun <BUILD, VALUE : Value<BigInteger>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, BigInteger>): AutoMappingConfiguration<BUILD>
@JvmName(name = "booleanMapper")
inline fun <BUILD, VALUE : Value<Boolean>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, Boolean>): AutoMappingConfiguration<BUILD>
@JvmName(name = "doubleMapper")
inline fun <BUILD, VALUE : Value<Double>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, Double>): AutoMappingConfiguration<BUILD>
@JvmName(name = "intMapper")
inline fun <BUILD, VALUE : Value<Int>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, Int>): AutoMappingConfiguration<BUILD>
@JvmName(name = "longMapper")
inline fun <BUILD, VALUE : Value<Long>> AutoMappingConfiguration<BUILD>.value(fn: ValueFactory<VALUE, Long>): AutoMappingConfiguration<BUILD>
Link copied to clipboard

This is the set of (additional) standardised string <-> type mappings which http4k supports out of the box.

Link copied to clipboard
inline fun <BUILDER, OUT> AutoMappingConfiguration<BUILDER>.yearMonth(noinline inFn: (YearMonth) -> OUT, noinline outFn: (OUT) -> YearMonth): AutoMappingConfiguration<BUILDER>
Link copied to clipboard