public String getConfigStr() { if (StringUtils.isEmpty(configStr)) { String format = "[type:simple] [step:{0}] [retryTimes:{1}] [tableInfo:{2}({3},{4},{5})]"; this.configStr = MessageFormat.format(format, String.valueOf(step), String.valueOf(retryTimes), tableName, nameColumnName, valueColumnName, gmtModifiedColumnName); } return configStr; }
通过MessageFormat进行字符格式拼接,比String.format跟方便
猜你喜欢
转载自www.cnblogs.com/sidesky/p/12985750.html
今日推荐
周排行