Class FacadeLocator
java.lang.Object
com.sap.cloud.sdk.cloudplatform.util.FacadeLocator
This class is for internal use only. It determines facades that are used to abstract certain logic, e.g., to adjust
to different platform services based on the current Cloud platform.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Performs the facade lookup within theFacadeLocator
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <FacadeT> io.vavr.control.Try<FacadeT>
Retrieves the facade for a given interface, allowing at most one implementation to exist.static <FacadeT> Collection<FacadeT>
getFacades
(Class<FacadeT> facadeInterface) Retrieves the facades for a given facade interface.Returns the currentFacadeLocator.MockableInstance
.static void
setMockableInstance
(FacadeLocator.MockableInstance mockableInstance) Replaces the defaultFacadeLocator.MockableInstance
.
-
Constructor Details
-
FacadeLocator
public FacadeLocator()
-
-
Method Details
-
getMockableInstance
Returns the currentFacadeLocator.MockableInstance
.For internal use only.
- Returns:
- The current
FacadeLocator.MockableInstance
.
-
setMockableInstance
Replaces the defaultFacadeLocator.MockableInstance
.For internal use only.
- Parameters:
mockableInstance
- The mockable instance.
-
getFacades
@Nonnull public static <FacadeT> Collection<FacadeT> getFacades(@Nonnull Class<FacadeT> facadeInterface) Retrieves the facades for a given facade interface.For internal use only.
- Type Parameters:
FacadeT
- The generic facade type.- Parameters:
facadeInterface
- The facade interface for which implementations should be located.- Returns:
- A collection of all instances of the class that implement the facade interface.
-
getFacade
@Nonnull public static <FacadeT> io.vavr.control.Try<FacadeT> getFacade(@Nonnull Class<FacadeT> facadeInterface) Retrieves the facade for a given interface, allowing at most one implementation to exist. Considered to fail if there is more than one facade.For internal use only.
- Type Parameters:
FacadeT
- The generic facade type.- Parameters:
facadeInterface
- The facade interface for which an implementation should be located.- Returns:
- A
Try
of the instance of the class that implements the facade interface.
-