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

io.sphere.internal.command.Update Maven / Gradle / Ivy

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

import java.util.ArrayList;
import java.util.List;

/** Update object which accumulates update actions and is used to construct a {@link UpdateCommand}.
 * The actions will be applied to the object in the order they were added. If one action fails
 * to be executed on the server, the whole update fails and none of the actions will be applied.  */
public abstract class Update {
    private List actions = new ArrayList();

    /** Adds an {@link UpdateAction} to the update.
     * @param action the action to add
     */
    protected void add(A action) {
        this.actions.add(action);
    }

    protected List getActions() { return actions; }
    
    /** @return true if the update contains no actions. */
    public boolean isEmpty() { return actions.isEmpty(); }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy