edu.emory.mathcs.backport.java.util.Arrays.asList()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(534)

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

Arrays.asList介绍

暂无

代码示例

代码示例来源:origin: org.nuxeo.ecm.platform/acaren-nuxeo-dafpic

@SuppressWarnings("rawtypes")
@Override
public List getTableNames(Connection connection) throws SQLException {
  return Arrays.asList(TABLES_NAMES);
}

代码示例来源:origin: co.cask.wrangler/wrangler-core

public MigrateToV2(String[] recipe) {
 this(Arrays.asList(recipe));
}

代码示例来源:origin: io.teecube.tic/tic-bw6

/**
 * @return a list of all files with ".substvar" extension in "META-INF" folder of the project.
 */
protected List<File> getAllSubstVarFiles() {
  FileFilter substVarFilter = new FileFilter() {
    @Override
    public boolean accept(File file) {
      return file.getName().toLowerCase().endsWith(".substvar");
    }
  };
  File[] substVarFiles = metaInfSource.listFiles(substVarFilter);
  List<File> result = new ArrayList<File>();
  List<?> substVarFilesList = Arrays.asList(substVarFiles);
  for (Object substVarFileObject : substVarFilesList) {
    File substVarFile = (File) substVarFileObject;
    result.add(substVarFile);
  }
  return result;
}

代码示例来源:origin: cinchapi/concourse

/**
 * Return a list of all the {@link AccountAttribute account attributes}.
 * 
 * @return the account attributes
 */
@SuppressWarnings("unchecked")
public static List<AccountAttribute> all() {
  return Arrays.asList(AccountAttribute.values());
}

代码示例来源:origin: backport-util-concurrent/backport-util-concurrent-java12

public boolean addAll(Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a collection of type " + type.getName());
  }
  return coll.addAll(Arrays.asList(checked));
}

代码示例来源:origin: backport-util-concurrent/backport-util-concurrent

public boolean addAll(Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a collection of type " + type.getName());
  }
  return coll.addAll(Arrays.asList(checked));
}

代码示例来源:origin: minnal/minnal

@Override
public void execute() {
  execute(Arrays.asList(new String[]{"mvn", "-X", "-f", projectDir + "/pom.xml", "compile", "exec:exec", "-Dexec.executable=java",
      "-DmainClass=org.minnal.generator.test.TestsGenerator", "-Dexec.args=-cp %classpath org.minnal.generator.test.TestsGenerator "
      + projectDir + " " + baseTestClass + " " + Joiner.on(",").join(packages)}));
}

代码示例来源:origin: backport-util-concurrent/backport-util-concurrent

public boolean addAll(int index, Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a list of type " + type.getName());
  }
  return list.addAll(index, Arrays.asList(checked));
}

代码示例来源:origin: backport-util-concurrent/backport-util-concurrent-java12

public boolean addAll(int index, Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a list of type " + type.getName());
  }
  return list.addAll(index, Arrays.asList(checked));
}

代码示例来源:origin: edu.emory.mathcs.backport/com.springsource.edu.emory.mathcs.backport

public boolean addAll(Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a collection of type " + type.getName());
  }
  return coll.addAll(Arrays.asList(checked));
}

代码示例来源:origin: edu.emory.mathcs.backport/com.springsource.edu.emory.mathcs.backport

public boolean addAll(int index, Collection c) {
  Object[] checked;
  try {
    checked = c.toArray(getEmptyArr());
  }
  catch (ArrayStoreException e) {
    throw new ClassCastException(
      "Attempted to insert an element of invalid type " +
      " to a list of type " + type.getName());
  }
  return list.addAll(index, Arrays.asList(checked));
}

代码示例来源:origin: apache/stanbol

@Override
public void initialise(){
  //this will call #importResource(..) for all files in the directories
  //configured by the #PARAM_SOURCE_FILE_OR_FOLDER
  loader.loadResources();
  //create the lists 
  vcardFiles = Arrays.asList(vcardFileImportFolder.listFiles(
    (FilenameFilter)VCardFileFilter.INSTANCE));
}

代码示例来源:origin: acaren-nuxeo-base/acaren-nuxeo-base-core

public EmptySectionsFieldfilter(CoreSession session) {
  this.session = session;
  this.lcFilter = new LifeCycleFilter((List<String>) Arrays.asList(ACCEPTED_LIFE_CYCLE_STATES), null);
}

代码示例来源:origin: ch.sbb.releasetrain/utils-impl

private void deleteFile(File file, String[] save) {
  List<String> list = Arrays.asList(save);
  list = new ArrayList<>(list);
  list.add(".git");
  String name = "";
  try {
    name = file.getCanonicalPath();
  } catch (IOException e) {
    log.error(e.getMessage(), e);
  }
  for (String blocker : list) {
    if (name.contains(blocker)) {
      return;
    }
  }
  file.delete();
}

代码示例来源:origin: minnal/minnal

@Override
  public void execute() {
    if (values.size() > 0) {
      projectDir = values.get(0);
    }
    execute(Arrays.asList(new String[]{"mvn", "-X", "-f", projectDir + "/pom.xml", "compile", "exec:exec", "-DmainClass=org.minnal.Bootstrap"}));
  }
}

代码示例来源:origin: btrplace/scheduler

public static Metrics sum(Metrics... metrics) {
  return sum(Arrays.asList(metrics));
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

@Override
public void executeTask() throws MojoExecutionException, MojoFailureException {
  if (Project.hasProject(new File(System.getProperty("user.dir")))) {
    feature = wizard.promptForMissingValueWithOptions("What feature would you like to add?", feature, "feature", Arrays.asList(OPTIONS), null, null);
    if(feature.equals(OPEN_WEB_APP) || feature.equals("owa")){
      addOwaSubmodule();
    } else {
      throw new IllegalArgumentException("Adding feature "+feature+" is not available. Available features: "+OPTIONS);
    }
  } else {
    throw new IllegalArgumentException("No project found in this directory. Please enter project's main directory and run this command again");
  }
}

代码示例来源:origin: btrplace/scheduler

public List<Constant> domain(Context mo) {
  Collection<?> col = (Collection<?>) backend.eval(mo);
  if ("<:".equals(op) || "/<:".equals(op)) {
    List<Object> s = new ArrayList<>(col);
    List<List<Object>> tuples = s.stream().map(o -> s).collect(Collectors.toList());
    AllTuplesGenerator<Object> tg = new AllTuplesGenerator<>(Object.class, tuples);
    Set<Constant> res = new HashSet<>();
    while (tg.hasNext()) {
      Object[] tuple = tg.next();
      res.add(new Constant(new HashSet<>(Arrays.asList(tuple)), backend.type()));
    }
    return new ArrayList<>(res);
  }
  List<Constant> s = new ArrayList<>();
  for (Object o : col) {
    s.add(new Constant(o, type()));
  }
  return s;
}

代码示例来源:origin: org.scala-tools/maven-scala-plugin

@SuppressWarnings("unchecked")
protected Cfg(ScalaGenJsonMojo data) throws Exception {
 groupId = data.project.getGroupId();
 artifactId = data.artifactId;
 version = data.project.getVersion();
 logo = data.logo;
 license = data.license;
 description = data.description;
 tags = data.tags;
 linksources = data.linksources;
 if (StringUtils.isBlank(license) && !data.project.getLicenses().isEmpty()) {
  License lic = (License) data.project.getLicenses().get(0);
  license = String.format("<a href='%s'>%s</a>", lic.getUrl(), lic.getName());
 }
 dependencies = makeDependencies(data);
 sources = makeSources(data);
 artifacts = makeArtifacts(data);
 if (data.args != null && data.args.length > 0) {
  additionnalArgs = Arrays.asList(data.args);
 }
 kind = makeKind(data);
}

代码示例来源:origin: net.sf.oqt/oqt-maven-plugin

@Test
public void testMainPackages() throws ClassNotFoundException {
  final Set<String> basePackages = new HashSet<String>(1);
  basePackages.add(CrossTable.class.getPackage().getName());
  final Set<PackageVO> packages = EntityFinder.findAllEntities(basePackages);
  assertThat(packages).isNotNull().isNotEmpty().hasSize(3);
  // FEST assert contains() method doesn't realy work very well
  assertThat(packages.containsAll(Arrays.asList(new PackageVO[] { new PackageVO(RefA.class.getPackage().getName()), new PackageVO(CrossTable.class.getPackage().getName()), new PackageVO(ImplementingTableA1.class.getPackage().getName()) }))).isEqualTo(true);
  final Iterator<PackageVO> it = packages.iterator();
  PackageVO p = it.next();
  assertThat(p.getName()).isNotNull().isNotEmpty().isEqualTo(TableA.class.getPackage().getName());
  assertThat(p.getEntities()).isNotNull().isNotEmpty().hasSize(TestInfo.numberOfEntities - TestInfo.numberOfEntitiesInGenericPackage - TestInfo.numberOfEntitiesInSubPackage);
  p = it.next();
  assertThat(p.getName()).isNotNull().isNotEmpty().isEqualTo(AbstractTableA.class.getPackage().getName());
  assertThat(p.getEntities()).isNotNull().isNotEmpty().hasSize(TestInfo.numberOfEntitiesInGenericPackage);
  p = it.next();
  assertThat(p.getName()).isNotNull().isNotEmpty().isEqualTo(RefA.class.getPackage().getName());
  assertThat(p.getEntities()).isNotNull().isNotEmpty().hasSize(TestInfo.numberOfEntitiesInSubPackage);
}

相关文章