1
1
package com .qiniu .process .filtration ;
2
2
3
+ import com .qiniu .util .ConvertingUtils ;
4
+
3
5
import java .io .IOException ;
4
6
import java .time .LocalDateTime ;
5
7
import java .util .List ;
@@ -111,7 +113,7 @@ public boolean filterKey(T item) {
111
113
public boolean filterMimeType (T item ) {
112
114
try {
113
115
if (item == null ) return false ;
114
- String mType = valueFrom (item , "mime" );
116
+ String mType = valueFrom (item , ConvertingUtils . defaultMimeField );
115
117
boolean result = false ;
116
118
if (checkList (mimeType )) {
117
119
result = mimeType .stream ().anyMatch (mType ::contains );
@@ -127,7 +129,7 @@ public boolean filterMimeType(T item) {
127
129
public boolean filterDatetime (T item ) {
128
130
try {
129
131
if (item == null ) return false ;
130
- LocalDateTime localDateTime = LocalDateTime .parse (valueFrom (item , "datetime" ));
132
+ LocalDateTime localDateTime = LocalDateTime .parse (valueFrom (item , ConvertingUtils . defaultDatetimeField ));
131
133
return localDateTime .compareTo (datetimeMax ) <= 0 && localDateTime .compareTo (datetimeMin ) >= 0 ;
132
134
} catch (Exception e ) {
133
135
return true ;
@@ -137,7 +139,7 @@ public boolean filterDatetime(T item) {
137
139
public boolean filterType (T item ) {
138
140
try {
139
141
if (item == null ) return false ;
140
- return valueFrom (item , "type" ).equals (type );
142
+ return valueFrom (item , ConvertingUtils . defaultTypeField ).equals (type );
141
143
} catch (NullPointerException e ) {
142
144
return true ;
143
145
}
@@ -146,7 +148,7 @@ public boolean filterType(T item) {
146
148
public boolean filterStatus (T item ) {
147
149
try {
148
150
if (item == null ) return false ;
149
- return valueFrom (item , "status" ).equals (status );
151
+ return valueFrom (item , ConvertingUtils . defaultStatusField ).equals (status );
150
152
} catch (NullPointerException e ) {
151
153
return true ;
152
154
}
0 commit comments