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

io.sphere.sdk.customobjects.commands.CustomObjectUpsertCommand Maven / Gradle / Ivy

There is a newer version: 1.0.0-M12
Show newest version
package io.sphere.sdk.customobjects.commands;

import io.sphere.sdk.commands.CreateCommandImpl;
import io.sphere.sdk.customobjects.CustomObject;
import io.sphere.sdk.customobjects.CustomObjectDraft;
import io.sphere.sdk.http.JsonEndpoint;

/**
 Command for creating or updating a custom object.
 Upsert is a synthetic word which has its origins from "update" and "insert".

 {@include.example io.sphere.sdk.customobjects.CustomObjectFixtures#createCustomObject()}

 @param  the type of the value in the custom object
 */
public class CustomObjectUpsertCommand extends CreateCommandImpl, CustomObjectDraft> {

    private CustomObjectUpsertCommand(final CustomObjectDraft draft) {
        super(draft, JsonEndpoint.of(draft.typeReference(), CustomObjectsEndpoint.PATH));
    }

    public static  CustomObjectUpsertCommand of(final CustomObjectDraft draft) {
        return new CustomObjectUpsertCommand<>(draft);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy