ConverterShape

data class ConverterShape(val sourceFqn: String, val targetFqn: String, val declaredToTotal: Boolean, val declaredToOrNull: Boolean, val declaredFromTotal: Boolean, val declaredFromOrNull: Boolean, val unsupportedToReason: String?, val unsupportedFromReason: String?, val orNullAnnotatedFunction: String?)

Which directions a converter provides, and any declared @UnsupportedDirection reasons.

A direction is PROVIDED iff its TOTAL method is declared AND not annotated @UnsupportedDirection — the annotation wins, because KSP cannot inspect function bodies (documented contract: the stub body is = unsupported()). An OrNull variant never provides a direction on its own: a hard landing site would call the throwing total at runtime, so an OrNull-only override is a guided compile error at resolution.

Constructors

Link copied to clipboard
constructor(sourceFqn: String, targetFqn: String, declaredToTotal: Boolean, declaredToOrNull: Boolean, declaredFromTotal: Boolean, declaredFromOrNull: Boolean, unsupportedToReason: String?, unsupportedFromReason: String?, orNullAnnotatedFunction: String?)

Properties

Link copied to clipboard

True when the convertFromOrNull variant is declared.

Link copied to clipboard

True when the total convertFrom is declared.

Link copied to clipboard

True when the convertToOrNull variant is declared.

Link copied to clipboard

True when the total convertTo is declared.

Link copied to clipboard

True when an OrNull variant carries a misplaced @UnsupportedDirection.

Link copied to clipboard

Name of the OrNull variant carrying a misplaced @UnsupportedDirection (e.g. "convertToOrNull"), or null when no OrNull variant is annotated — compile error at resolution, naming the offending function.

Link copied to clipboard

convertFromOrNull declared without its total — compile error when T -> S is needed.

Link copied to clipboard

convertToOrNull declared without its total — compile error when S -> T is needed.

Link copied to clipboard

True when the T -> S direction is provided: total convertFrom declared, not annotated.

Link copied to clipboard

True when the S -> T direction is provided: total convertTo declared, not annotated.

Link copied to clipboard

FQN of the converter's source type S in MapTypeConverter.

Link copied to clipboard

FQN of the converter's target type T in MapTypeConverter.

Link copied to clipboard

Reason from @UnsupportedDirection on convertFrom, or null when not annotated.

Link copied to clipboard

Reason from @UnsupportedDirection on convertTo, or null when not annotated.