Skip to content

Commit 0fcbdfa

Browse files
committed
further wrote javadoc
1 parent 6b5ecb2 commit 0fcbdfa

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

APIJSONORM/src/main/java/apijson/StringUtil.java

+15-8
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ public static String getString(Object[] array, boolean ignoreEmptyItem) {
111111
public static String getString(Object[] array, String split) {
112112
return getString(array, split, false);
113113
}
114+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
114115
/**获取string,为null则返回""
115-
* @param array
116-
* @param split
117-
* @param ignoreEmptyItem
118-
* @return
116+
* @param array -the str array given
117+
* @param split -the token used to split
118+
* @param ignoreEmptyItem -whether to ignore empty item or not
119+
* @return {@link #getString(Object[], String, boolean)}
120+
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
119121
*/
120122
public static String getString(Object[] array, String split, boolean ignoreEmptyItem) {
121123
StringBuilder s = new StringBuilder("");
@@ -530,10 +532,13 @@ public static String getNumber(CharSequence cs) {
530532
public static String getNumber(String s) {
531533
return getNumber(s, false);
532534
}
535+
536+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
533537
/**去掉string内所有非数字类型字符
534-
* @param s
538+
* @param s -string passed in
535539
* @param onlyStart 中间有非数字时只获取前面的数字
536-
* @return
540+
* @return limit String
541+
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
537542
*/
538543
public static String getNumber(String s, boolean onlyStart) {
539544
if (isNotEmpty(s, true) == false) {
@@ -631,10 +636,12 @@ public static String getCorrectEmail(String email) {
631636
public static String getPrice(String price) {
632637
return getPrice(price, PRICE_FORMAT_DEFAULT);
633638
}
639+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182
634640
/**获取价格,保留两位小数
635-
* @param price
641+
* @param price -price passed in
636642
* @param formatType 添加单位(元)
637-
* @return
643+
* @return limit String
644+
* <p>Here we replace the simple "+" way of concatenating with Stringbuilder 's append</p>
638645
*/
639646
public static String getPrice(String price, int formatType) {
640647
if (isNotEmpty(price, true) == false) {

APIJSONORM/src/main/java/apijson/orm/AbstractParser.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1375,9 +1375,11 @@ public synchronized void putQueryResult(String path, Object result) {
13751375
queryResultMap.put(path, result);
13761376
// }
13771377
}
1378+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
13781379
/**根据路径获取值
1379-
* @param valuePath
1380+
* @param valuePath -the path need to get value
13801381
* @return parent == null ? valuePath : parent.get(keys[keys.length - 1])
1382+
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
13811383
*/
13821384
@Override
13831385
public Object getValueByPath(String valuePath) {

APIJSONORM/src/main/java/apijson/orm/AbstractSQLConfig.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -1329,10 +1329,12 @@ public AbstractSQLConfig setCombine(Map<String, List<String>> combine) {
13291329
public Object getWhere(String key) {
13301330
return getWhere(key, false);
13311331
}
1332+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
13321333
/**
1333-
* @param key
1334-
* @param exactMatch
1334+
* @param key - the key passed in
1335+
* @param exactMatch - whether it is exact match
13351336
* @return
1337+
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
13361338
*/
13371339
@JSONField(serialize = false)
13381340
@Override
@@ -2273,11 +2275,13 @@ public static JSONArray newJSONArray(Object obj) {
22732275
public String getSetString() throws Exception {
22742276
return getSetString(getMethod(), getContent(), ! isTest());
22752277
}
2278+
//CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48
22762279
/**获取SET
2277-
* @param method
2278-
* @param content
2280+
* @param method -the method used
2281+
* @param content -the content map
22792282
* @return
2280-
* @throws Exception
2283+
* @throws Exception
2284+
* <p>use entrySet+getValue() to replace keySet+get() to enhance efficiency</p>
22812285
*/
22822286
@JSONField(serialize = false)
22832287
public String getSetString(RequestMethod method, Map<String, Object> content, boolean verifyName) throws Exception {

0 commit comments

Comments
 (0)