@@ -39,7 +39,8 @@ public PageRequest(int current, int pageSize, Sort sort) {
39
39
ServletRequestAttributes attributes = (ServletRequestAttributes ) RequestContextHolder .currentRequestAttributes ();
40
40
this .servletRequest = attributes .getRequest ();
41
41
this .syncParameter ();
42
- }catch (Exception e ){}
42
+ } catch (Exception e ) {
43
+ }
43
44
}
44
45
45
46
@@ -48,7 +49,7 @@ private void syncParameter() {
48
49
while (enumeration .hasMoreElements ()) {
49
50
String key = enumeration .nextElement ();
50
51
String value = servletRequest .getParameter (key );
51
- if (StringUtils .hasText (value )) {
52
+ if (StringUtils .hasText (value )) {
52
53
this .filters .put (key , value );
53
54
}
54
55
}
@@ -80,6 +81,28 @@ public int getIntParameter(String key, int defaultValue) {
80
81
return result == null ? defaultValue : Integer .parseInt (result );
81
82
}
82
83
84
+ public Map <String , Object > getFilters () {
85
+ return filters ;
86
+ }
87
+
88
+ public String getStringFilter (String key ) {
89
+ return (String ) filters .get (key );
90
+ }
91
+
92
+ public String getStringFilter (String key , String defaultValue ) {
93
+ String result = (String ) filters .get (key );
94
+ return result == null ? defaultValue : result ;
95
+ }
96
+
97
+ public int getIntFilter (String key ) {
98
+ return Integer .parseInt ((String ) filters .get (key ));
99
+ }
100
+
101
+ public int getIntFilter (String key , int defaultValue ) {
102
+ String result = (String ) filters .get (key );
103
+ return result == null ? defaultValue : Integer .parseInt (result );
104
+ }
105
+
83
106
84
107
@ Override
85
108
public int getPageSize () {
0 commit comments