This commit is contained in:
Redkale
2016-07-21 15:39:32 +08:00
parent 7ed0020b1d
commit 1b42a4241a

View File

@@ -98,6 +98,11 @@ public final class Flipper implements Serializable, Cloneable {
return sort;
}
public static Flipper sortIfAbsent(Flipper flipper, String sort) {
if (flipper != null) return flipper.sortIfAbsent(sort);
return flipper;
}
public Flipper sortIfAbsent(String sort) {
if (this.sort == null || this.sort.isEmpty()) {
this.sort = sort;