Browse Source

增加filter\removerFilter方法

suntg 9 years ago
parent
commit
c2fe1c328a
1 changed files with 14 additions and 0 deletions
  1. 14 0
      search-api/src/main/java/com/uas/search/model/PageParams.java

+ 14 - 0
search-api/src/main/java/com/uas/search/model/PageParams.java

@@ -1,6 +1,7 @@
 package com.uas.search.model;
 
 import java.io.Serializable;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -53,4 +54,17 @@ public class PageParams implements Serializable {
 		this.filters = filters;
 	}
 
+	public void filter(String key, Object value) {
+		if (this.filters == null) {
+			this.filters = new HashMap<String, Object>();
+		}
+		this.filters.put(key, value);
+	}
+
+	public void removeFilter(String key) {
+		if (this.filters != null) {
+			this.filters.remove(key);
+		}
+	}
+
 }