TomlLiteralString

@SerialInfo
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class TomlLiteralString(source)

Marks the annotated String property as literal when encoded.

class LiteralStringData(
@TomlLiteralString
val literalString: String
)
LiteralStringData("C:\\Users\\<User>\\.m2\\repositories")

will produce:

literalString = 'C:\Users\<User>\.m2\repositories'

Types

Link copied to clipboard
object Companion