From 0c6f26bc6a49dec3dbe04d43373744651ba08505 Mon Sep 17 00:00:00 2001 From: Kalven Date: Mon, 2 Sep 2019 17:02:02 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-1117=20=E5=8A=A0=E5=85=A5=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=8C=E6=9B=B4=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/api/cal/ParameterKit.java | 18 ++++++++++-------- .../com/fanruan/api/cal/ParameterKitTest.java | 7 +++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/fanruan/api/cal/ParameterKit.java b/src/main/java/com/fanruan/api/cal/ParameterKit.java index 4807a7d..e3c3f92 100644 --- a/src/main/java/com/fanruan/api/cal/ParameterKit.java +++ b/src/main/java/com/fanruan/api/cal/ParameterKit.java @@ -37,6 +37,15 @@ public class ParameterKit { return new Parameter(name, value); } + /** + * 根据参数名创建新的参数对象 + * @param name 参数名 + * @return 参数对象 + */ + public static @NotNull ParameterProvider createNewParameter(String name) { + return new Parameter(name); + } + /** * 从字符串中分析中有哪些需要的参数 * @@ -90,12 +99,5 @@ public class ParameterKit { return ParameterMapNameSpace.create(ps); } - /** - * 根据参数名创建新的参数对象 - * @param content 参数名 - * @return 参数对象 - */ - public static @NotNull ParameterProvider createNewParameter(String content) { - return new Parameter(content); - } + } diff --git a/src/test/java/com/fanruan/api/cal/ParameterKitTest.java b/src/test/java/com/fanruan/api/cal/ParameterKitTest.java index 9292107..1c66498 100644 --- a/src/test/java/com/fanruan/api/cal/ParameterKitTest.java +++ b/src/test/java/com/fanruan/api/cal/ParameterKitTest.java @@ -107,4 +107,11 @@ public class ParameterKitTest extends Prepare { Assert.assertEquals("p1", provider.getName()); Assert.assertEquals("124", provider.getValue()); } + + @Test + public void createNewParameter() { + ParameterProvider provider = ParameterKit.createNewParameter("p1"); + Assert.assertEquals(provider.getName(),"p1"); + Assert.assertEquals("", provider.getValue()); + } } \ No newline at end of file