本文整理匯總了Java中com.sandwich.util.SimpleEntry類的典型用法代碼示例。如果您正苦於以下問題:Java SimpleEntry類的具體用法?Java SimpleEntry怎麽用?Java SimpleEntry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SimpleEntry類屬於com.sandwich.util包,在下文中一共展示了SimpleEntry類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testUnanticipatedArgument_yieldsMethodArg_constructedImplicitly
import com.sandwich.util.SimpleEntry; //導入依賴的package包/類
@Test
public void testUnanticipatedArgument_yieldsMethodArg_constructedImplicitly() throws Exception {
String value =
"if string isn't a known command line arg (ArgumentType) or class - assume its a method";
Entry<ArgumentType, CommandLineArgument> anticipatedResult =
new SimpleEntry<ArgumentType, CommandLineArgument>(ArgumentType.METHOD_ARG,
new CommandLineArgument(ArgumentType.METHOD_ARG, value));
Map<ArgumentType, CommandLineArgument> commandLineArgs =
new CommandLineArgumentBuilder(value);
assertEquals(1, commandLineArgs.size());
assertEquals(anticipatedResult, commandLineArgs.entrySet().iterator().next());
}
示例2: testMethodArg_constructedExplicitly
import com.sandwich.util.SimpleEntry; //導入依賴的package包/類
@Test
public void testMethodArg_constructedExplicitly() throws Exception {
String value = "someMethodName";
Entry<ArgumentType, CommandLineArgument> anticipatedResult =
new SimpleEntry<ArgumentType, CommandLineArgument>(ArgumentType.METHOD_ARG,
new CommandLineArgument(ArgumentType.METHOD_ARG, value));
Map<ArgumentType, CommandLineArgument> commandLineArgs = new CommandLineArgumentBuilder(
ArgumentType.METHOD_ARG.args().iterator().next(),
value);
assertEquals(1, commandLineArgs.size());
assertEquals(anticipatedResult, commandLineArgs.entrySet().iterator().next());
}