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

io.sphere.sdk.commands.MetaModelByIdDeleteCommandBuilder Maven / Gradle / Ivy

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

import io.sphere.sdk.client.JsonEndpoint;
import io.sphere.sdk.expansion.ExpansionPath;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.ResourceView;
import io.sphere.sdk.models.Versioned;

import java.util.List;
import java.util.function.Function;

import static java.util.Objects.requireNonNull;

/**
 Internal builder.
 @param  the type of the result of the command
 @param  the type of the expansion model
 */
public class MetaModelByIdDeleteCommandBuilder, C, E> extends Base implements Builder {
    final Versioned versioned;
    final JsonEndpoint endpoint;
    final E expansionModel;
    List> expansionPaths;
    final Function, C> creationFunction;

    MetaModelByIdDeleteCommandBuilder(final MetaModelByIdDeleteCommandImpl template) {
        this.creationFunction = requireNonNull(template.creationFunction);
        this.expansionModel = requireNonNull(template.expansionModel);
        this.expansionPaths = requireNonNull(template.expansionPaths);
        this.versioned = requireNonNull(template.versioned);
        this.endpoint = requireNonNull(template.endpoint);
    }

    @Override
    public C build() {
        return creationFunction.apply(this);
    }


    MetaModelByIdDeleteCommandBuilder expansionPaths(final List> expansionPaths) {
        this.expansionPaths = expansionPaths;
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy