api

http4k / org.http4k.format / AutoMappingConfiguration

AutoMappingConfiguration

interface AutoMappingConfiguration<T> (source)

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

Name Summary
bigDecimal abstract fun <OUT> bigDecimal(mapping: BiDiMapping<BigDecimal, OUT>): AutoMappingConfiguration<T>
bigInteger abstract fun <OUT> bigInteger(mapping: BiDiMapping<BigInteger, OUT>): AutoMappingConfiguration<T>
boolean abstract fun <OUT> boolean(mapping: BiDiMapping<Boolean, OUT>): AutoMappingConfiguration<T>
done abstract fun done(): T
Finalise the mapping configurations.
double abstract fun <OUT> double(mapping: BiDiMapping<Double, OUT>): AutoMappingConfiguration<T>
int abstract fun <OUT> int(mapping: BiDiMapping<Int, OUT>): AutoMappingConfiguration<T>
long abstract fun <OUT> long(mapping: BiDiMapping<Long, OUT>): AutoMappingConfiguration<T>
prohibitStrings open fun prohibitStrings(): AutoMappingConfiguration<T>
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.
text abstract fun <OUT> text(mapping: BiDiMapping<String, OUT>): AutoMappingConfiguration<T>

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T
withStandardMappings fun <T> AutoMappingConfiguration<T>.withStandardMappings(): AutoMappingConfiguration<T>
This is the set of (additional) standardised string <-> type mappings which http4k supports out of the box.