You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gdms/src/utils/Utils.java

29 lines
780 B

package utils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Utils {
public static Map<String,Integer> userAttrNum =new HashMap<>()
{
{
userAttrNum.put("administrator",5);
userAttrNum.put("student",7);
userAttrNum.put("teacher",8);
}
};
public static String toUpperFirstChar(String string) {
char[] charArray = string.toCharArray();
charArray[0] -= 32;
return String.valueOf(charArray);
}
public static List<String> formatUserInfo(String userType, List<String> userInfo){
for(int i=0;i<userAttrNum.get(userType)-userInfo.size();i++){
userInfo.add("");
}
return userInfo;
}
}