1.以前老是用try catch来判断对象类型,现在要用instanceof了,特别是spring integration有比较多会传递不同的payload type
if( sth instanceof String){
//string type
}else if(sth instanceof Integer){
//Integer type
}
1.以前老是用try catch来判断对象类型,现在要用instanceof了,特别是spring integration有比较多会传递不同的payload type
if( sth instanceof String){
//string type
}else if(sth instanceof Integer){
//Integer type
}