Flipper的limit可以设置为0

This commit is contained in:
Redkale
2018-01-04 20:02:51 +08:00
parent 7250bf8047
commit 402255ba0d

View File

@@ -33,7 +33,7 @@ public final class Flipper implements Serializable, Cloneable {
}
public Flipper(int limit) {
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
this.limit = limit > 0 ? limit : 0;
}
public Flipper(String sortColumn) {
@@ -41,17 +41,17 @@ public final class Flipper implements Serializable, Cloneable {
}
public Flipper(int limit, int offset) {
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
this.limit = limit > 0 ? limit : 0;
this.offset = offset < 0 ? 0 : offset;
}
public Flipper(int limit, String sortColumn) {
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
this.limit = limit > 0 ? limit : 0;
this.sort = sortColumn;
}
public Flipper(int limit, int offset, String sortColumn) {
this.limit = limit > 0 ? limit : DEFAULT_LIMIT;
this.limit = limit > 0 ? limit : 0;
this.offset = offset < 0 ? 0 : offset;
this.sort = sortColumn;
}
@@ -93,9 +93,7 @@ public final class Flipper implements Serializable, Cloneable {
}
public void setLimit(int limit) {
if (limit > 0) {
this.limit = limit;
}
this.limit = limit;
}
public Flipper limit(int limit) {
@@ -121,9 +119,7 @@ public final class Flipper implements Serializable, Cloneable {
}
public void setSort(String sort) {
if (sort != null) {
this.sort = sort.trim();
}
this.sort = sort == null ? "" : sort.trim();
}
public Flipper sort(String sort) {