Beetl工具包扩展
parent
18355fb691
commit
c7cfbb102a
@ -1,26 +1,26 @@
|
||||
package com.ibeetl.admin.core.util.beetl;
|
||||
|
||||
import org.beetl.core.Context;
|
||||
import org.beetl.core.Function;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 忽略大小写的比较
|
||||
*/
|
||||
@Component
|
||||
public class EqualsIgnoreCaseFunction implements Function {
|
||||
|
||||
@Override
|
||||
public Object call(Object[] objects, Context context) {
|
||||
try{
|
||||
if(objects != null && objects.length == 2){
|
||||
String left = objects[0].toString();
|
||||
String right = objects[1].toString();
|
||||
return left.equalsIgnoreCase(right);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//package com.ibeetl.admin.core.util.beetl;
|
||||
//
|
||||
//import org.beetl.core.Context;
|
||||
//import org.beetl.core.Function;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * 忽略大小写的比较
|
||||
// */
|
||||
//@Component
|
||||
//public class EqualsIgnoreCaseFunction implements Function {
|
||||
//
|
||||
// @Override
|
||||
// public Object call(Object[] objects, Context context) {
|
||||
// try{
|
||||
// if(objects != null && objects.length == 2){
|
||||
// String left = objects[0].toString();
|
||||
// String right = objects[1].toString();
|
||||
// return left.equalsIgnoreCase(right);
|
||||
// }
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
Loading…
Reference in New Issue