Class NamedProviderBridge<S,T>

Object
NamedProviderBridge<S,T>
Type Parameters:
S - source-type that is converted from.
T - destination-type that is converted to.
All Implemented Interfaces:
NamedProvider<T>

public class NamedProviderBridge<S,T> extends Object implements NamedProvider<T>
Exposes elements in a NamedProvider as a different type.
Author:
Owen Feehan
  • Constructor Details

    • NamedProviderBridge

      public NamedProviderBridge(NamedProvider<S> provider, CheckedFunction<S,T,? extends Exception> bridge)
      Creates with a particular provider and bridge.
      Parameters:
      provider - the NamedProvider that supplies elements, before conversion.
      bridge - a function that converts the elements in provider as they are accessed.
    • NamedProviderBridge

      public NamedProviderBridge(NamedProvider<S> provider, CheckedFunction<S,T,? extends Exception> bridge, boolean bridgeNulls)
      Creates a new NamedProviderBridge instance.
      Parameters:
      provider - The NamedProvider that supplies elements, before conversion.
      bridge - A function that converts the elements in provider as they are accessed.
      bridgeNulls - Whether to apply the bridge function to null values.

      Iff true, the bridge function is applied to null values. If false, a Optional.empty() is returned instead.

  • Method Details