Interface BinaryCollectionSoftwareComponent>

Type Parameters:
T - type of the elements in this container.

public interface BinaryCollectionSoftwareComponent>
A collection of binaries that are created and configured as they are required.

Each element in this collection passes through several states. The element is created and becomes 'known'. The element is passed to any actions registered using whenElementKnown(Action). The element is then configured using any actions registered using configureEach(Action) and becomes 'finalized'. The element is passed to any actions registered using whenElementFinalized(Action). Elements are created and configured only when required.

Since:
4.5
  • Method Details

    • get

       BinaryProvider get(Class type, Spec spec)
      Returns a BinaryProvider that contains the single binary matching the specified type and specification. The binary will be in the finalized state. The provider can be used to apply configuration to the element before it is finalized.

      Querying the return value will fail when there is not exactly one matching binary.

      Type Parameters:
      S - type of the binary to return
      Parameters:
      type - type to match
      spec - specification to satisfy. The spec is applied to each binary prior to configuration.
      Returns:
      a binary from the collection in a finalized state
    • getByName

      BinaryProvider<T> getByName(String name)
      Returns a BinaryProvider that contains the single binary with the given name. The binary will be in the finalized state. The provider can be used to apply configuration to the element before it is finalized.

      Querying the return value will fail when there is not exactly one matching binary.

      Parameters:
      name - The name of the binary
      Returns:
      a binary from the collection in a finalized state
    • get

      BinaryProvider<T> get(SpecT> spec)
      Returns a Provider that contains the single binary matching the given specification. The binary will be in the finalized state. The provider can be used to apply configuration to the element before it is finalized.

      Querying the return value will fail when there is not exactly one matching binary.

      Parameters:
      spec - specification to satisfy. The spec is applied to each binary prior to configuration.
      Returns:
      a binary from the collection in a finalized state
    • whenElementKnown

      void whenElementKnown(ActionT> action)
      Registers an action to execute when an element becomes known. The action is only executed for those elements that are required. Fails if any element has already been finalized.
      Parameters:
      action - The action to execute for each element becomes known.
    • whenElementKnown

       void whenElementKnown(Class type, Action action)
      Registers an action to execute when an element of the given type becomes known. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.
      Parameters:
      type - The type of element to select.
      action - The action to execute for each element becomes known.
    • whenElementFinalized

      void whenElementFinalized(ActionT> action)
      Registers an action to execute when an element is finalized. The action is only executed for those elements that are required. Fails if any element has already been finalized.
      Parameters:
      action - The action to execute for each element when finalized.
    • whenElementFinalized

       void whenElementFinalized(Class type, Action action)
      Registers an action to execute when an element of the given type is finalized. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.
      Parameters:
      type - The type of element to select.
      action - The action to execute for each element when finalized.
    • configureEach

      void configureEach(ActionT> action)
      Registers an action to execute to configure each element in the collection. The action is only executed for those elements that are required. Fails if any element has already been finalized.
      Parameters:
      action - The action to execute on each element for configuration.
    • configureEach

       void configureEach(Class type, Action action)
      Registers an action to execute to configure each element of the given type in the collection. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.
      Parameters:
      type - The type of element to select.
      action - The action to execute on each element for configuration.
    • get

      Set<T> get()
      Returns the set of binaries from this collection. Elements are in a finalized state.