ValidationFailed

class ValidationFailed(val key: String, val rawValue: String?, val reason: String) : ConfigError(source)

A value converted fine but broke a validation rule, or the config class's init block rejected the loaded values. rawValue is null in the second case and *** for secrets.

Constructors

Link copied to clipboard
constructor(key: String, rawValue: String?, reason: String)

Properties

Link copied to clipboard
open override val key: String

The key that failed, as looked up in the source that supplied the value. For a missing key it is the SCREAMING_SNAKE form (or the @Key name). For a failed init check it is the spec's prefix, such as DATABASE for a nested spec, or the class name when there is none.

Link copied to clipboard
open override val message: String

A readable description of the problem, used in ConfigException's message.

Link copied to clipboard

The text read from the source, *** for a @Secret field, or null for an init check.

Link copied to clipboard

What rule was broken, e.g. must be at least 1, or the require message.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String