package com.gh.gamecenter.common.baselist;

/**
 * Created by khy on 6/03/18.
 */

public class LoadParams {

    public final static int DEFAULT_PAGE_SIZE = 20;

    public final static int DEFAULT_OFFSET = 1;

    private int loadSize;

    private int loadOffset;

    private Object loadKey;

    public LoadParams(int loadOffset) {
        this.loadOffset = loadOffset;
    }

    public LoadParams(int loadSize, int loadOffset) {
        this.loadSize = loadSize;
        this.loadOffset = loadOffset;
    }

    public LoadParams(int loadSize, int loadOffset, Object loadKey) {
        this.loadSize = loadSize;
        this.loadOffset = loadOffset;
        this.loadKey = loadKey;
    }

    public int getLoadSize() {
        return loadSize <= 0 ? DEFAULT_PAGE_SIZE : loadSize;
    }

    public void setLoadSize(int loadSize) {
        this.loadSize = loadSize;
    }

    public int getLoadOffset() {
        return loadOffset;
    }

    public void setLoadOffset(int loadOffset) {
        this.loadOffset = loadOffset;
    }

    public Object getLoadKey() {
        return loadKey;
    }

    public void setLoadKey(Object loadKey) {
        this.loadKey = loadKey;
    }


    public void init() {
        loadOffset = 0;
    }
}
