boolean idFlag = false;
if(propertyList.contains("ID")){
idFlag = true;
int index = propertyList.indexOf("ID");
Collections.swap(propertyList, index, 0);
}
if(propertyList.contains("NAME")){
int index = propertyList.indexOf("NAME");
if(idFlag){
Collections.swap(propertyList, index, 1);
}else{
Collections.swap(propertyList, index, 0);
}
}
Give your valuable comment
Keep Visiting :)
if(propertyList.contains("ID")){
idFlag = true;
int index = propertyList.indexOf("ID");
Collections.swap(propertyList, index, 0);
}
if(propertyList.contains("NAME")){
int index = propertyList.indexOf("NAME");
if(idFlag){
Collections.swap(propertyList, index, 1);
}else{
Collections.swap(propertyList, index, 0);
}
}
Give your valuable comment
Keep Visiting :)
No comments:
Post a Comment