本文整理汇总了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());
}