Package: org.gradle.api

## [Java] Interface NamedDomainObjectSet<T>

- java.util.Collection

- All Superinterfaces:
    Iterable, DomainObjectCollection, NamedDomainObjectCollection, Collection

  A specialisation of NamedDomainObjectCollection that also implements Set and orders objects by their inherent name.

  All object equality is determined in terms of object names. That is, calling `remove()` with an object that is NOT equal to an existing object in terms of `equals`, but IS in terms of name equality will result in the existing collection item with the equal name being removed.

  Parameters:
    `` - The type of element in the set

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Set<T>` | `findAll(groovy.lang.Closure spec)` {@inheritDoc}
    `NamedDomainObjectSet<T>` | `matching(Spec<? super T> spec)` {@inheritDoc}
    `NamedDomainObjectSet<T>` | `matching(groovy.lang.Closure spec)` {@inheritDoc}
    `NamedDomainObjectSet<S>` | `withType(Class<S> type)` {@inheritDoc}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface NamedDomainObjectCollection` | `add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getNames, getRules, matching, matching, withType`
    `interface Set` | `add, equals, hashCode, clear, contains, isEmpty, size, toArray, toArray, addAll, iterator, remove, containsAll, removeAll, retainAll`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Method Detail

    - #### public Set<T> findAll(groovy.lang.Closure spec)

      {@inheritDoc}

    - #### public NamedDomainObjectSet<T> matching(Spec<? super T> spec)

      {@inheritDoc}

    - #### public NamedDomainObjectSet<T> matching(groovy.lang.Closure spec)

      {@inheritDoc}

    - #### public NamedDomainObjectSet<S> withType(Class<S> type)

      {@inheritDoc}