Module org.apache.felix.atomos
Package org.apache.felix.atomos

## Interface Atomos.HeaderProvider

All Superinterfaces:
  `BiFunction<String,​Map<String,​String>,​Optional<Map<String,​String>>>`

Enclosing interface:
  Atomos

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    @ConsumerType
    public static interface Atomos.HeaderProvider
    extends BiFunction<String,​Map<String,​String>,​Optional<Map<String,​String>>>

A function that maps each `AtomosContent` `location` and its existing headers to a new optional map of headers to be used for the `headers` of the `ConnectContent`.

### Method Summary

All Methods Instance Methods Abstract Methods
`Optional<Map<String,​String>>` `apply​(String location, Map<String,​String> existingHeaders)` Applies this header provider function to the specified `AtomosContent` `location` and map of existing headers.

### Methods inherited from interface java.util.function.BiFunction

`andThen`

### Method Detail

#### apply

    Optional<Map<String,​String>> apply​(String location,
                                             Map<String,​String> existingHeaders)

Applies this header provider function to the specified `AtomosContent` `location` and map of existing headers. The returned `Optional` map of headers will be used by the `ConnectContent.getHeaders()` method for the `ConnectContent` `associated` with the `AtomosContent` that has the specified `location`.

This method allows a header provider to augment existing bundle manifest headers or add completely new bundle manifest headers that are not present in the existing headers.

This function may be applied before the instance of the `AtomosContent` instance is created which may result in the symbolic name and or version of the `AtomosContent` to be influenced by this function.

Specified by:
  `apply` in interface `BiFunction<String,​Map<String,​String>,​Optional<Map<String,​String>>>`
Parameters:
  `location` - The `AtomosContent` `location`
  `existingHeaders` - The existing headers found for the `AtomosContent`
Returns:
  the `Optional` map of headers to use instead of the `existingHeaders`. If the existing headers should be used then an empty `Optional` may be returned.