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

io.sphere.sdk.projects.commands.ProjectUpdateCommand Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.projects.commands;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.sphere.sdk.commands.Command;
import io.sphere.sdk.commands.UpdateAction;
import io.sphere.sdk.projects.Project;

import java.util.Collections;
import java.util.List;

/**
 * Update commands for the {@link Project} entity
 *{@include.example io.sphere.sdk.projects.commands.ProjectUpdateActionsIntegrationTest#execution()}
 */
public interface ProjectUpdateCommand extends Command {

    /**
     * The expected version of the project on which the changes should be applied.
     * If the expected version does not match the actual version, a 409 Conflict will be returned.
     * @return Project version
     */
    Long getVersion() ;

    /**
     * The list of update actions to be performed on the project.
     * @return update actions list
     */
    List> getActions();


    static ProjectUpdateCommand of(final Project project, final List> actions) {
        return ProjectUpdateCommandImpl.of(project, actions);
    }

    static ProjectUpdateCommand of(final Project project, final UpdateAction action) {
        return of(project, Collections.singletonList(action));
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy