Required
@Target(allowedTargets = [AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY ] )
Marks a field as required in the configuration.
If the field is missing or blank in the loaded configuration, an error will be reported. If soft is true, the absence will be logged as a warning instead of throwing an error.
This annotation also allows specifying a custom name to report in logs via named.
Example:
@Required
String apiKey;
@Required(soft = true, named = "logChannelId")
String logChannel;Content copied to clipboard