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

com.heliorm.impl.OrderedPart Maven / Gradle / Ivy

The newest version!
package com.heliorm.impl;

import com.heliorm.def.Complete;
import com.heliorm.def.Executable;

import java.util.List;

/**
 * @author gideon
 */
public final class OrderedPart< DO> extends ExecutablePart implements Complete {


    private final SelectPart< DO> select;
    private final List> order;

    public OrderedPart(Selector selector, SelectPart< DO> select, List> order, LimitPart limit) {
        super(selector);
        this.select = select;
        this.order = order;
        this.select.setLimit(limit);
    }

    @Override
    public SelectPart getSelect() {
        return select;
    }

    @Override
    public List> getOrder() {
        return order;
    }

    @Override
    public LimitPart getLimit() {
        return select.getLimit();
    }

    @Override
    public Executable limit(int from, int number) {
        this.select.setLimit(new LimitPart(from, number));
        return this;
    }

    @Override
    public Executable limit(int number) {
        return limit(0, number);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy