# Nested

@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.METHOD, ElementType.FIELD])
annotation class Nested(source)

Marks a property as specifying a nested bean, whose properties should be checked for annotations.

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.

Gradle will attempt to instantiate a nested bean on abstract getter methods annotated with this annotation. This creates a read-only managed nested property.

The implementation of the nested bean is tracked as an input, too. This allows tracking behavior such as org.gradle.api.Actions as task inputs.

This annotations supports org.gradle.api.provider.Provider values by treating the result of get as a nested bean.

This annotation supports Iterable values by treating each element as a separate nested bean. As a property name, the index of the element in the iterable prefixed by `$` is used, e.g. `$0`. If the element implements org.gradle.api.Named, then the property name is composed of getName and the index, e.g. `name$1`. The ordering of the elements in the iterable is crucial for reliable up-to-date checks and caching.

This annotation supports java.util.Map values by treating each value of the map as a separate nested bean. The keys of the map are used as property names.

## Functions

annotationType
Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
hashCode
Link copied to clipboard
abstract fun hashCode(): Int
toString
Link copied to clipboard
abstract fun toString(): String