further wrote javadoc

This commit is contained in:
Rkyzzy 2021-04-25 01:26:57 +08:00
parent 6b5ecb2f1d
commit 0fcbdfab03
3 changed files with 27 additions and 14 deletions

View File

@ -111,11 +111,13 @@ public class StringUtil {
public static String getString(Object[] array, String split) {
return getString(array, split, false);
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
/**获取string,为null则返回""
* @param array
* @param split
* @param ignoreEmptyItem
* @return
* @param array -the str array given
* @param split -the token used to split
* @param ignoreEmptyItem -whether to ignore empty item or not
* @return {@link #getString(Object[], String, boolean)}
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
*/
public static String getString(Object[] array, String split, boolean ignoreEmptyItem) {
StringBuilder s = new StringBuilder("");
@ -530,10 +532,13 @@ public class StringUtil {
public static String getNumber(String s) {
return getNumber(s, false);
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
/**去掉string内所有非数字类型字符
* @param s
* @param s -string passed in
* @param onlyStart 中间有非数字时只获取前面的数字
* @return
* @return limit String
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
*/
public static String getNumber(String s, boolean onlyStart) {
if (isNotEmpty(s, true) == false) {
@ -631,10 +636,12 @@ public class StringUtil {
public static String getPrice(String price) {
return getPrice(price, PRICE_FORMAT_DEFAULT);
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
/**获取价格保留两位小数
* @param price
* @param price -price passed in
* @param formatType 添加单位
* @return
* @return limit String
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
*/
public static String getPrice(String price, int formatType) {
if (isNotEmpty(price, true) == false) {

View File

@ -1375,9 +1375,11 @@ public abstract class AbstractParser<T> implements Parser<T>, ParserCreator<T>,
queryResultMap.put(path, result);
// }
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
/**根据路径获取值
* @param valuePath
* @param valuePath -the path need to get value
* @return parent == null ? valuePath : parent.get(keys[keys.length - 1])
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
*/
@Override
public Object getValueByPath(String valuePath) {

View File

@ -1329,10 +1329,12 @@ public abstract class AbstractSQLConfig implements SQLConfig {
public Object getWhere(String key) {
return getWhere(key, false);
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
/**
* @param key
* @param exactMatch
* @param key - the key passed in
* @param exactMatch - whether it is exact match
* @return
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
*/
@JSONField(serialize = false)
@Override
@ -2273,11 +2275,13 @@ public abstract class AbstractSQLConfig implements SQLConfig {
public String getSetString() throws Exception {
return getSetString(getMethod(), getContent(), ! isTest());
}
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
/**获取SET
* @param method
* @param content
* @param method -the method used
* @param content -the content map
* @return
* @throws Exception
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
*/
@JSONField(serialize = false)
public String getSetString(RequestMethod method, Map<String, Object> content, boolean verifyName) throws Exception {