public class ProductCommandRequest extends java.lang.Object implements CommandRequest<Product>
Constructor and Description |
---|
ProductCommandRequest(CategoryTree categoryTree,
CommandRequest<BackendProduct> underlyingRequest,
ApiMode apiMode) |
ProductCommandRequest(CategoryTree categoryTree,
CommandRequest<BackendProduct> underlyingRequest,
ApiMode apiMode,
com.google.common.base.Function<SphereBackendException,SphereException> transformError) |
Modifier and Type | Method and Description |
---|---|
Product |
execute()
Executes the request and returns the result.
|
com.google.common.util.concurrent.ListenableFuture<SphereResult<Product>> |
executeAsync()
Executes the request asynchronously and returns a future providing the result.
|
CommandRequest<Product> |
withErrorHandling(com.google.common.base.Function<SphereBackendException,SphereException> transformError)
Transforms a generic error result from the Sphere backend into a specific error, depending on the use case.
|
public ProductCommandRequest(@Nonnull CategoryTree categoryTree, @Nonnull CommandRequest<BackendProduct> underlyingRequest, @Nonnull ApiMode apiMode)
public ProductCommandRequest(@Nonnull CategoryTree categoryTree, @Nonnull CommandRequest<BackendProduct> underlyingRequest, @Nonnull ApiMode apiMode, com.google.common.base.Function<SphereBackendException,SphereException> transformError)
public Product execute()
CommandRequest
execute
in interface CommandRequest<Product>
public com.google.common.util.concurrent.ListenableFuture<SphereResult<Product>> executeAsync()
CommandRequest
executeAsync
in interface CommandRequest<Product>
public CommandRequest<Product> withErrorHandling(@Nonnull com.google.common.base.Function<SphereBackendException,SphereException> transformError)
CommandRequest
withErrorHandling
in interface CommandRequest<Product>