api / org.gradle.api.tasks / Optional

Optional

@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER]) class Optional

Marks a task property as optional. This means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

Constructors

<init>

Optional()

Marks a task property as optional. This means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored.

  • org.gradle.api.tasks.Input
  • org.gradle.api.tasks.InputFile
  • org.gradle.api.tasks.InputDirectory
  • org.gradle.api.tasks.InputFiles
  • org.gradle.api.tasks.OutputFile
  • org.gradle.api.tasks.OutputDirectory