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

io.sphere.sdk.search.model.SearchModelImpl Maven / Gradle / Ivy

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

import io.sphere.sdk.models.Base;

import javax.annotation.Nullable;

public class SearchModelImpl extends Base implements SearchModel {
    @Nullable
    private final SearchModel parent;
    @Nullable
    private final String pathSegment;

    protected SearchModelImpl(@Nullable final SearchModel parent, @Nullable final String pathSegment) {
        this.parent = parent;
        this.pathSegment = pathSegment;
    }

    protected SearchModelImpl(@Nullable final String pathSegment) {
        this(null, pathSegment);
    }

    //for testing
    SearchModelImpl appended(final String pathSegment) {
        return new SearchModelImpl<>(this, pathSegment) ;
    }

    @Nullable
    @Override
    public String getPathSegment() {
        return pathSegment;
    }

    @Nullable
    @Override
    public SearchModel getParent() {
        return parent;
    }

    protected SearchModel searchModel(final String pathSegment) {
        return new SearchModelImpl<>(this, pathSegment);
    }

    protected BooleanSearchModel booleanSearchModel(final String pathSegment) {
        return new BooleanSearchModel<>(this, pathSegment);
    }

    protected StringSearchModel stringSearchModel(final String pathSegment) {
        return new StringSearchModel<>(this, pathSegment);
    }

    protected NumberSearchModel numberSearchModel(final String pathSegment) {
        return new NumberSearchModel<>(this, pathSegment);
    }

    protected DateSearchModel dateSearchModel(final String pathSegment) {
        return new DateSearchModel<>(this, pathSegment);
    }

    protected TimeSearchModel timeSearchModel(final String pathSegment) {
        return new TimeSearchModel<>(this, pathSegment);
    }

    protected DateTimeSearchModel datetimeSearchModel(final String pathSegment) {
        return new DateTimeSearchModel<>(this, pathSegment);
    }

    protected LocalizedStringFilterSearchModel localizedStringFilterSearchModel(final String pathSegment) {
        return new LocalizedStringFilterSearchModel<>(this, pathSegment);
    }

    protected LocalizedStringFacetSearchModel localizedStringFacetSearchModel(final String pathSegment) {
        return new LocalizedStringFacetSearchModel<>(this, pathSegment);
    }

    protected LocalizedStringFacetAndFilterSearchModel localizedStringFacetAndFilterSearchModel(final String pathSegment) {
        return new LocalizedStringFacetAndFilterSearchModel<>(this, pathSegment);
    }

    protected EnumFilterSearchModel enumFilterSearchModel(final String pathSegment) {
        return new EnumFilterSearchModel<>(this, pathSegment);
    }

    protected EnumFacetSearchModel enumFacetSearchModel(final String pathSegment) {
        return new EnumFacetSearchModel<>(this, pathSegment);
    }

    protected EnumFacetAndFilterSearchModel enumFacetAndFilterSearchModel(final String pathSegment) {
        return new EnumFacetAndFilterSearchModel<>(this, pathSegment);
    }

    protected LocalizedEnumFilterSearchModel localizedEnumFilterSearchModel(final String pathSegment) {
        return new LocalizedEnumFilterSearchModel<>(this, pathSegment);
    }

    protected LocalizedEnumFacetSearchModel localizedEnumFacetSearchModel(final String pathSegment) {
        return new LocalizedEnumFacetSearchModel<>(this, pathSegment);
    }

    protected LocalizedEnumFacetAndFilterSearchModel localizedEnumFacetAndFilterSearchModel(final String pathSegment) {
        return new LocalizedEnumFacetAndFilterSearchModel<>(this, pathSegment);
    }

    protected MoneyFilterSearchModel moneyFilterSearchModel(final String pathSegment) {
        return new MoneyFilterSearchModel<>(this, pathSegment);
    }

    protected MoneyFacetSearchModel moneyFacetSearchModel(final String pathSegment) {
        return new MoneyFacetSearchModel<>(this, pathSegment);
    }

    protected MoneyFacetAndFilterSearchModel moneyFacetAndFilterSearchModel(final String pathSegment) {
        return new MoneyFacetAndFilterSearchModel<>(this, pathSegment);
    }

    protected ReferenceFilterSearchModel referenceFilterSearchModel(final String pathSegment) {
        return new ReferenceFilterSearchModel<>(this, pathSegment);
    }

    protected ReferenceFacetSearchModel referenceFacetSearchModel(final String pathSegment) {
        return new ReferenceFacetSearchModel<>(this, pathSegment);
    }

    protected ReferenceFacetAndFilterSearchModel referenceFacetAndFilterSearchModel(final String pathSegment) {
        return new ReferenceFacetAndFilterSearchModel<>(this, pathSegment);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy