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

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

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

import javax.annotation.Nullable;

public class SortableSearchModel> extends SearchModelImpl {
    protected final SearchSortFactory searchSortFactory;

    protected SortableSearchModel(@Nullable final SearchModel parent, @Nullable final String pathSegment,
                               final SearchSortFactory searchSortFactory) {
        super(parent, pathSegment);
        this.searchSortFactory = searchSortFactory;
    }

    public S sorted() {
        return sorted(this);
    }

    public S sorted(final String pathSegment) {
        return new SortableSearchModel<>(this, pathSegment, searchSortFactory).sorted();
    }

    public S sorted(final SortableSearchModel searchModel) {
        return searchSortFactory.apply(searchModel);
    }

    @Override
    protected SortableSearchModel searchModel(final String pathSegment) {
        return new SortableSearchModel<>(this, pathSegment, searchSortFactory);
    }

    protected SortableSearchModel searchModel(final SearchModel parent, final String pathSegment) {
        return new SortableSearchModel<>(parent, pathSegment, searchSortFactory);
    }

    protected LocalizedStringSortSearchModel localizedStringSortSearchModel(final String pathSegment) {
        return new LocalizedStringSortSearchModel<>(this, pathSegment, searchSortFactory);
    }

    protected EnumSortSearchModel enumSortSearchModel(final String pathSegment) {
        return new EnumSortSearchModel<>(this, pathSegment, searchSortFactory);
    }

    protected LocalizedEnumSortSearchModel localizedEnumSortSearchModel(final String pathSegment) {
        return new LocalizedEnumSortSearchModel<>(this, pathSegment, searchSortFactory);
    }

    protected MoneySortSearchModel moneySortSearchModel(final String pathSegment) {
        return new MoneySortSearchModel<>(this, pathSegment, searchSortFactory);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy