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

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

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

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import io.sphere.sdk.commands.DeleteCommand;
import io.sphere.sdk.customobjects.CustomObject;

/**
 * Deletes a custom object in SPHERE.IO.
 *
 *
 */
public interface CustomObjectDeleteCommand> extends DeleteCommand {
    static > DeleteCommand of(final T customObject, final TypeReference typeReference) {
        return of(customObject.getContainer(), customObject.getKey(), typeReference);
    }

    static > DeleteCommand of(final String container, final String key, final TypeReference typeReference) {
        return new CustomObjectDeleteCommandImpl<>(container, key, typeReference);
    }

    /**
     * Deletes a custom object. Convenience method to not specify the {@link com.fasterxml.jackson.core.type.TypeReference} but lacking the accessible value in the result.
     * @param customObject the custom object to delete
     * @param  the type of the whole custom object
     * @return custom object only with meta data
     */
    static > DeleteCommand> of(final T customObject) {
        return of(customObject.getContainer(), customObject.getKey());
    }

    static DeleteCommand> of(final String container, final String key) {
        return new CustomObjectDeleteCommandImpl<>(container, key, new TypeReference>() {

        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy