Skip to content

Commit 13afc66

Browse files
committed
Supplement the contents of documents; organize the codes;
1 parent ca11af8 commit 13afc66

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/main/java/net/lamgc/utils/base/ArgumentsProperties.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,27 @@ public class ArgumentsProperties extends HashMap<String, String>{
1919

2020
private ArrayList<String> keyList = new ArrayList<>();
2121

22+
/**
23+
* 构造一个ArgumentsProperties.
24+
* 该ArgumentsProperties将使用默认的参数标识来解析参数.
25+
*/
2226
public ArgumentsProperties(){
2327
this(null);
2428
}
2529

30+
/**
31+
* 构造一个ArgumentsProperties并解析参数数组中的参数.
32+
* @param args 参数列表, 比如从{@code main(String[] args)}方法参数中获得的参数.
33+
*/
2634
public ArgumentsProperties(String[] args){
2735
this(args, null);
2836
}
2937

30-
// 对指定参数提供过滤选项,以在使用不正确选项的时候抛出异常
38+
/**
39+
* 构造一个ArgumentsProperties
40+
* @param args 待解析的参数列表
41+
* @param keyFlags 参数Key标识列表
42+
*/
3143
public ArgumentsProperties(String[] args, String[] keyFlags){
3244
this.keyFlags = keyFlags == null ? defaultKeyFlags : keyFlags;
3345
if(args != null){

src/test/java/net/lamgc/utils/ArgumentsPropertiesTest.java renamed to src/test/java/net/lamgc/utils/base/ArgumentsPropertiesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.lamgc.utils;
1+
package net.lamgc.utils.base;
22

33
import net.lamgc.utils.base.ArgumentsProperties;
44
import org.junit.Test;
@@ -7,7 +7,7 @@
77

88
public class ArgumentsPropertiesTest{
99

10-
private final String[] argsList = new String[]{"/a", "233", "/b : 12", "-c", "34", "-d:56", "--EF", "78", "--GH:90", "/IJ", "--KL", "-MN"};
10+
private final String[] argsList = {"/a", "233", "/b : 12", "-c", "34", "-d:56", "--EF", "78", "--GH:90", "/IJ", "--KL", "-MN"};
1111

1212
@Test
1313
public void loadTest(){

0 commit comments

Comments
 (0)