Package com.castlabs.sdk.downloader.network

# Class NetworkModifiersHolder

java.lang.Object
com.castlabs.sdk.downloader.network.NetworkModifiersHolder

public final class NetworkModifiersHolder extends Object
Holder for network modifiers that keeps track of filters and exposes proxy lists for usage.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NetworkModifiersHolder()`
  Creates an empty holder without registered modifiers.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addRequestModifier(RequestModifier modifier, RequestModifierFilter filter)`
  Adds a request modifier with an optional filter.
  `void`
  `addResponseModifier(ResponseModifier modifier, ResponseModifierFilter filter)`
  Adds a response modifier with an optional filter.
  `void`
  `clearRequestModifiers()`
  Clears all request modifiers.
  `void`
  `clearResponseModifiers()`
  Clears all response modifiers.
  `List<RequestModifier>`
  `getRequestModifiers()`
  Returns the current snapshot of request modifiers.
  `List<ResponseModifier>`
  `getResponseModifiers()`
  Returns the current snapshot of response modifiers.
  `void`
  `removeRequestModifier(RequestModifier modifier)`
  Removes a request modifier if present.
  `void`
  `removeResponseModifier(ResponseModifier modifier)`
  Removes a response modifier if present.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NetworkModifiersHolder

    public NetworkModifiersHolder()
    Creates an empty holder without registered modifiers.

- ## Method Details

  - ### addRequestModifier

    public void addRequestModifier(@NonNull RequestModifier modifier, @Nullable RequestModifierFilter filter)
    Adds a request modifier with an optional filter.
    Parameters:
      `modifier` - Request modifier to add
      `filter` - Filter restricting when the modifier is applied

  - ### removeRequestModifier

    public void removeRequestModifier(@NonNull RequestModifier modifier)
    Removes a request modifier if present.
    Parameters:
      `modifier` - Request modifier to remove

  - ### clearRequestModifiers

    public void clearRequestModifiers()
    Clears all request modifiers.

  - ### getRequestModifiers

    @NonNull public List<RequestModifier> getRequestModifiers()
    Returns the current snapshot of request modifiers.
    Returns:
      Immutable list of registered request modifiers

  - ### addResponseModifier

    public void addResponseModifier(@NonNull ResponseModifier modifier, @Nullable ResponseModifierFilter filter)
    Adds a response modifier with an optional filter.
    Parameters:
      `modifier` - Response modifier to add
      `filter` - Filter restricting when the modifier is applied

  - ### removeResponseModifier

    public void removeResponseModifier(@NonNull ResponseModifier modifier)
    Removes a response modifier if present.
    Parameters:
      `modifier` - Response modifier to remove

  - ### clearResponseModifiers

    public void clearResponseModifiers()
    Clears all response modifiers.

  - ### getResponseModifiers

    @NonNull public List<ResponseModifier> getResponseModifiers()
    Returns the current snapshot of response modifiers.
    Returns:
      Immutable list of registered response modifiers