Class DestinationLoaderChain

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoaderChain
All Implemented Interfaces:
DestinationLoader

public class DestinationLoaderChain extends Object implements DestinationLoader
Immutable implementation of the DestinationLoader interface providing a way to define a chain DestinationLoaders to go through until a destination was found.
  • Constructor Details

  • Method Details

    • builder

      @Nonnull public static DestinationLoaderChain.DestinationLoaderChainBuilder builder(@Nonnull DestinationLoader firstLoader)
      Entry point to build a custom DestinationLoaderChain.
      Parameters:
      firstLoader - The first loader to be used by the chain.
      Returns:
      A DestinationLoaderChainBuilder without any registered DestinationLoaderChain.
    • tryGetDestination

      @Nonnull public io.vavr.control.Try<Destination> tryGetDestination(@Nonnull String destinationName, @Nonnull DestinationOptions options)
      Description copied from interface: DestinationLoader
      Retrieves a destination for the given name and configuration options.

      The returned Try object will contain a DestinationNotFoundException in case the destination could not be found or a DestinationAccessException with more details in case something else went wrong.

      If the returned Try object contains no Exception it will always contain a non-null Destination value.

      Specified by:
      tryGetDestination in interface DestinationLoader
      Parameters:
      destinationName - The name of the destination to obtain.
      options - Additional settings to modify the behaviour of the destination loader.
      Returns:
      A Try object containing either the non-null Destination value or an exception.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object