com.lone.common.util.CommUtils Maven / Gradle / Ivy
The newest version!
package com.lone.common.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.lone.common.exception.BusinessException;
/**
* @author 王春勇
* @version V1.0
*/
public class CommUtils {
/**
* 排除相应名称的属性,返回剩余属性键对
* String filterName[]={"name1","name2","name3"};
* @param filterName
* @return
*/
@SuppressWarnings("unchecked")
public static Map attributeMapFilter(Map map,String[] filterName)
{
for(int i=0;i mapConvert(Map map) {
Map dataMap= new HashMap(0);
if(map!=null){
Iterator it=map.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry=(Map.Entry)it.next();
Object ok=entry.getKey();
Object ov=entry.getValue()==null?"":entry.getValue();
String key=ok.toString();
String keyval="";
String[] value=new String[1];
if(ov instanceof String[]){
value=(String[])ov;
}else{
value[0]=ov.toString();
}
keyval+=value[0];
for(int k=1;k mapConvertO(Map map) {
Map dataMap= new HashMap(0);
if(map!=null){
Iterator it=map.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry=(Map.Entry)it.next();
Object ok=entry.getKey();
Object ov=entry.getValue()==null?"":entry.getValue();
String key=ok.toString();
String keyval="";
Object[] value=new Object[1];
if(ov instanceof String[]){
value=(String[])ov;
}else{
value[0]=ov;
}
keyval+=value[0];
for(int k=1;k> mapKeytoLowerCase(List