org.crsh.util.Utils.list()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.crsh.util.Utils.list()方法的一些代码示例,展示了Utils.list()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.list()方法的具体详情如下:
包路径:org.crsh.util.Utils
类名称:Utils
方法名:list

Utils.list介绍

暂无

代码示例

代码示例来源:origin: crashub/crash

@Override
protected Iterable<PropertyDescriptor<?>> createConfigurationCapabilities() {
 return Utils.<PropertyDescriptor<?>>list(SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM, DEBUG);
}

代码示例来源:origin: crashub/crash

public static <E> List<E> list(Iterable<E> iterable) {
 return list(iterable.iterator());
}

代码示例来源:origin: crashub/crash

synchronized Iterable<CRaSHPlugin<?>> getPlugins() {
 if (plugins == null) {
  List<CRaSHPlugin<?>> plugins = Utils.list(discovery.getPlugins());
  for (CRaSHPlugin<?> plugin : plugins) {
   plugin.context = context;
   plugin.status = CRaSHPlugin.CONSTRUCTED;
  }
  this.plugins = plugins;
 }
 return plugins;
}

代码示例来源:origin: crashub/crash

List<File> files = Utils.list(stream);
Collections.sort(files);
TableElement table = new TableElement().overflow(Overflow.WRAP).rightCellPadding(1);

代码示例来源:origin: crashub/crash

private void assertReader(ScreenBuffer reader, Object... expected) {
  List<Object> res = Utils.list(reader);
  assertEquals(expected.length, res.size());
  for (int i = 0;i < expected.length;i++) {
   assertEquals(expected[i], res.get(i));
  }
 }
}

代码示例来源:origin: crashub/crash

List<Thread> threads = Utils.list(stream);

代码示例来源:origin: crashub/crash

List<Integer> list = Utils.list((Iterable<Integer>)columns);
int[] weights = new int[list.size()];
for (int i = 0;i < weights.length;i++) {
List<Integer> list = Utils.list((Iterable<Integer>)rows);
int[] weights = new int[list.size()];
for (int i = 0;i < weights.length;i++) {

代码示例来源:origin: crashub/crash

closureArgs = Utils.list((Iterable)ret).toArray();

代码示例来源:origin: crashub/crash

public void testSingle() {
  TestMap map = new TestMap();
  map.state.put("a", "b");
  assertEquals(1, map.size());
  assertEquals("b", map.get("a"));
  assertEquals(Utils.list("a"), Utils.list(map.keys()));
 }
}

代码示例来源:origin: crashub/crash

public void testDir() throws Exception {
 File root = toExploded(archive, "");
 ClassLoader cl = new URLClassLoader(new URL[]{root.toURI().toURL()}, parent);
 ClasspathResolver resolver = new ClasspathResolver(cl);
 // No recurse
 List<JavaFileObject> classes = collect(Utils.list(resolver.resolve("java.util", false)));
 assertEquals(2, classes.size());
 assertEndsWith("/HashMap.class", classes.get(0).getName());
 assertEndsWith("/Map.class", classes.get(1).getName());
 // Recurse
 classes = collect(Utils.list(resolver.resolve("java.util", true)));
 assertEquals(3, classes.size());
 assertEndsWith("/ConcurrentHashMap.class", classes.get(0).getName());
 assertEndsWith("/HashMap.class", classes.get(1).getName());
 assertEndsWith("/Map.class", classes.get(2).getName());
}

代码示例来源:origin: crashub/crash

public void testJar() throws Exception {
 File jar = toFile(this.archive, ".jar");
 ClassLoader cl = new URLClassLoader(new URL[]{jar.toURI().toURL()}, parent);
 ClasspathResolver resolver = new ClasspathResolver(cl);
 // No recurse
 List<JavaFileObject> classes = collect(Utils.list(resolver.resolve("java.util", false)));
 assertEquals(2, classes.size());
 assertEndsWith("/HashMap.class", classes.get(0).getName());
 assertEndsWith("/Map.class", classes.get(1).getName());
 // Recurse
 classes = collect(Utils.list(resolver.resolve("java.util", true)));
 assertEquals(3, classes.size());
 assertEndsWith("/ConcurrentHashMap.class", classes.get(0).getName());
 assertEndsWith("/HashMap.class", classes.get(1).getName());
 assertEndsWith("/Map.class", classes.get(2).getName());
}

代码示例来源:origin: crashub/crash

List<ObjectName> names = Utils.list(stream);
Collections.sort(names);

代码示例来源:origin: crashub/crash

public void testIntersect() throws Exception {
 output.clear();
 lifeCycle.bindGroovy("consume_command", consume_command);
 lifeCycle.bindGroovy("produce_command", produce_command);
 assertOk("produce_command | filter -p A:C -p B:A | consume_command");
 assertEquals(list(map(map("A", "C"), "B", "A")), output);
}

代码示例来源:origin: crashub/crash

public void testSimple() throws Exception {
 output.clear();
 lifeCycle.bindGroovy("consume_command", consume_command);
 lifeCycle.bindGroovy("produce_command", produce_command);
 assertOk("produce_command | filter -p A:C | consume_command");
 assertEquals(list(map(map("A", "C"), "B", "A")), output);
}

代码示例来源:origin: crashub/crash

public void testEmpty() {
 TestMap map = new TestMap();
 assertEquals(0, map.size());
 assertEquals(null, map.get("a"));
 assertEquals(Collections.<String>emptyList(), Utils.list(map.keys()));
}

代码示例来源:origin: crashub/crash

public void testMany() throws Exception {
 output.clear();
 lifeCycle.bindGroovy("consume_command", consume_command);
 lifeCycle.bindGroovy("produce_command", produce_command);
 assertOk("produce_command | filter -p A:C -p A:B | consume_command");
 assertEquals(list(map(map("A", "B"), "B", "B"), map(map("A", "C"), "B", "A")), output);
}

代码示例来源:origin: crashub/crash

List<JavaFileObject> classes = collect(Utils.list(resolver.resolve("java.util", false)));
assertEquals(2, classes.size());
assertEndsWith("/HashMap.class", classes.get(0).getName());
classes = collect(Utils.list(resolver.resolve("java.util", true)));
assertEquals(3, classes.size());
assertEndsWith("/ConcurrentHashMap.class", classes.get(0).getName());

代码示例来源:origin: org.crashub/crash.shell

synchronized Iterable<CRaSHPlugin<?>> getPlugins() {
 if (plugins == null) {
  List<CRaSHPlugin<?>> plugins = Utils.list(discovery.getPlugins());
  for (CRaSHPlugin<?> plugin : plugins) {
   plugin.context = context;
   plugin.status = CRaSHPlugin.CONSTRUCTED;
  }
  this.plugins = plugins;
 }
 return plugins;
}

代码示例来源:origin: org.crsh/crsh.shell.core

synchronized Iterable<CRaSHPlugin<?>> getPlugins() {
 if (plugins == null) {
  List<CRaSHPlugin<?>> plugins = Utils.list(discovery.getPlugins());
  for (CRaSHPlugin<?> plugin : plugins) {
   plugin.context = context;
   plugin.status = CRaSHPlugin.CONSTRUCTED;
  }
  this.plugins = plugins;
 }
 return plugins;
}

代码示例来源:origin: com.github.corda.crash/crash.shell

synchronized Iterable<CRaSHPlugin<?>> getPlugins() {
 if (plugins == null) {
  List<CRaSHPlugin<?>> plugins = Utils.list(discovery.getPlugins());
  for (CRaSHPlugin<?> plugin : plugins) {
   plugin.context = context;
   plugin.status = CRaSHPlugin.CONSTRUCTED;
  }
  this.plugins = plugins;
 }
 return plugins;
}

相关文章