package jp.sourceforge.shovel.entity.impl;

import static jp.sourceforge.shovel.SortOrderType.*;

import jp.sourceforge.shovel.MethodType;
import jp.sourceforge.shovel.SortOrderType;
import jp.sourceforge.shovel.ViewType;
import jp.sourceforge.shovel.entity.IListRefine;

public class ListRefineImpl implements IListRefine {
    MethodType methodType_;
    int page_;
    SortOrderType sortOrderType_;
    ViewType viewType_;
    
    public ListRefineImpl() {
    }
    public String getMethod() {
        return getMethodType().getId();
    }
    public void setMethod(String id) {
        setMethodType(MethodType.find(id));
    }
    public MethodType getMethodType() {
        return methodType_;
    }
    public void setMethodType(MethodType methodType) {
        methodType_ = methodType;
    }
    public int getPage() {
        return page_;
    }
    public void setPage(int page) {
        page_ = page;
    }
    public String getSortOrder() {
        return getSortOrderType().getSortOrder();
    }
    public void setSortOrder(String sortOrder) {
        setSortOrderType(SortOrderType.find(sortOrder));
    }
    public SortOrderType getSortOrderType() {
        return sortOrderType_ == null ? DESC : sortOrderType_;
    }
    public void setSortOrderType(SortOrderType sortOrderType) {
        sortOrderType_ = sortOrderType;
    }
    public ViewType getViewType() {
        return viewType_;
    }
    public void setViewType(ViewType viewType) {
        viewType_ = viewType;
    }
}
