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

io.sphere.sdk.queries.MetaModelGetDslBuilder Maven / Gradle / Ivy

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

import io.sphere.sdk.client.JsonEndpoint;
import io.sphere.sdk.expansion.ExpansionPath;
import io.sphere.sdk.http.HttpQueryParameter;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;

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

/**
 *
 * @param  result type, maybe directly {@code T} or sth. like {@code List}
 * @param  type a single result item
 * @param  type of the class implementing this class
 * @param  type of the expansion model
 */
public class MetaModelGetDslBuilder, E> extends Base implements Builder {

    JsonEndpoint endpoint;
    String identifierToSearchFor;
    List> expansionPaths;
    List additionalParameters;
    E expansionModel;
    Function, C> builderFunction;

    MetaModelGetDslBuilder(final MetaModelGetDslImpl template) {
        endpoint = template.endpoint;
        identifierToSearchFor = template.identifierToSearchFor;
        expansionPaths = template.expansionPaths;
        additionalParameters = template.additionalParameters;
        expansionModel = template.expansionModel;
        builderFunction = template.builderFunction;
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy