All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.client.CommandRequest Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client;

import com.google.common.base.Function;
import com.google.common.util.concurrent.ListenableFuture;
import io.sphere.client.exceptions.SphereBackendException;
import io.sphere.client.exceptions.SphereException;
import net.jcip.annotations.Immutable;

import javax.annotation.Nonnull;

/** Request that sends a commands to the Sphere backend. */
@Immutable
public interface CommandRequest {
    /** Executes the request and returns the result. */
    T execute();

    /** Executes the request asynchronously and returns a future providing the result. */
    ListenableFuture> executeAsync();

    /** Transforms a generic error result from the Sphere backend into a specific error, depending on the use case. */
    CommandRequest withErrorHandling(@Nonnull Function transformError);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy