springMVC模型驱动set,get再加工理解

模型驱动都都是通过调用相关的set,get方法操作值,为了加工可以在处理这两个方法逻辑

public class BaseConditionVo {

public final static int PAGE_SHOW_COUNT = 20;

private int pageNum = 1;

private Integer pageSize = 0;

private int totalCount = 0;

private String orderField;

private String orderDirection;

 

public void setOrderDirection(String orderDirection) {

this.orderDirection = orderDirection;

}

 

public String getOrderDirection() {

return "desc".equals(orderDirection) ? "desc" : "asc";

}

 

public void setPageSize(Integer pageSize) {

this.pageSize = pageSize;

}

 

public Integer getPageSize() {

return (pageSize!=null&&pageSize > 0) ? pageSize : PAGE_SHOW_COUNT;

}

 

你可能感兴趣的:(模型驱动)