Package-level declarations

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class CollectionWrapper(val forType: KClass<*>)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ConvertFrom(val use: KClass<out MapTypeConverter<*, *>> = MapTypeConverter::class, val onFail: OnFail = OnFail.Auto)

Direction-scoped per-field override: applies only to the @MapFrom (reverse) direction; beats @ConvertWith there. Same parameter shape as ConvertWithuse left at its sentinel default means "keep the auto-discovered converter".

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ConvertTo(val use: KClass<out MapTypeConverter<*, *>> = MapTypeConverter::class, val onFail: OnFail = OnFail.Auto)

Direction-scoped per-field override: applies only to the @MapTo (forward) direction; beats @ConvertWith there. Same parameter shape as ConvertWithuse left at its sentinel default means "keep the auto-discovered converter".

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ConvertWith(val use: KClass<out MapTypeConverter<*, *>> = MapTypeConverter::class, val onFail: OnFail = OnFail.Auto)

Per-field OVERRIDE of converter resolution and/or brokenness policy (both directions). Never required for discovery — built-ins and @KMapperConfig converters are pair-discovered. use left at its sentinel default means "keep the auto-discovered converter".

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class FieldMap(val fieldName: String, val targetClass: KClass<*> = Nothing::class)
Link copied to clipboard
typealias Ignore = IgnoreMap

1.x name of IgnoreMap — same semantics, clearer name in 2.0.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class IgnoreDefaultValue

Mapping treats this field's constructor default as nonexistent: the default is Kotlin construction convenience, NOT a wire fallback. Absence becomes RequiredFieldMissing; the field is built in the constructor stage (not omit/copy). No-op warning without a default.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class IgnoreMap

The mapper pretends this field does not exist for auto-matching: its value never flows through mapping; the target slot falls back to its constructor default or becomes a required external parameter on the generated function.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class KMapperConfig(val converters: Array<KClass<*>> = [], val wrappers: Array<KClass<*>> = [])
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class MapDefaultValue(val expression: String)

1.x expression-based fallback — removed without an annotation replacement: the Kotlin constructor default IS the fallback in 2.0. Declare val plan: String = "FREE" on the target; mapping omits the argument so the default applies (and IgnoreDefaultValue opts a default out of being a wire fallback).

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class MapFrom(val source: KClass<*>)
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class MapTo(val target: KClass<*>)
Link copied to clipboard
enum OnFail : Enum<OnFail>

Brokenness policy for a failed conversion. Absence is ALWAYS type-driven (nullable/default) — never a policy.

Link copied to clipboard

1.x name of ConvertWith. Note the parameter rename: 1.x converter = X::class is 2.0 use = X::class (plus the new per-field onFail policy).

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class Validate(val validators: KClass<out Validator<*>>)

Field-anchored validation: whenever this field participates in a mapping — as source (validated BEFORE conversion) or as target (validated AFTER) — its value runs through the validators. Fires at mapping time only; failure is a hard ValidationFailed.

Link copied to clipboard

1.x source-side validation — replaced by the field-anchored Validate: one declaration on the field that OWNS the rule fires before conversion when the field is a source and after conversion when it is a target, in every generated direction.

Link copied to clipboard
typealias ValidateTo = Validate

1.x target-side validation — see ValidateFrom; both names collapse into Validate.