Interface NamedDomainObjectContainer<T>

    • Method Detail

      • create

        T create​(java.lang.String name)
          throws InvalidUserDataException
        Creates a new item with the given name, adding it to this container.
        Parameters:
        name - The name to assign to the created object
        Returns:
        The created object. Never null.
        Throws:
        InvalidUserDataException - if an object with the given name already exists in this container.
      • maybeCreate

        T maybeCreate​(java.lang.String name)
        Looks for an item with the given name, creating and adding it to this container if it does not exist.
        Parameters:
        name - The name to find or assign to the created object
        Returns:
        The found or created object. Never null.
      • create

        T create​(java.lang.String name,
                 Closure configureClosure)
          throws InvalidUserDataException
        Creates a new item with the given name, adding it to this container, then configuring it with the given closure.
        Parameters:
        name - The name to assign to the created object
        configureClosure - The closure to configure the created object with
        Returns:
        The created object. Never null.
        Throws:
        InvalidUserDataException - if an object with the given name already exists in this container.
      • create

        T create​(java.lang.String name,
                 Action<? super T> configureAction)
          throws InvalidUserDataException
        Creates a new item with the given name, adding it to this container, then configuring it with the given action.
        Parameters:
        name - The name to assign to the created object
        configureAction - The action to configure the created object with
        Returns:
        The created object. Never null.
        Throws:
        InvalidUserDataException - if an object with the given name already exists in this container.
      • configure

        NamedDomainObjectContainer<T> configure​(Closure configureClosure)

        Allows the container to be configured, creating missing objects as they are referenced.

        TODO: example usage

        Specified by:
        configure in interface Configurable<T>
        Parameters:
        configureClosure - The closure to configure this container with
        Returns:
        This.