List of usage examples for com.google.common.collect Lists asList
public static <E> List<E> asList(@Nullable E first, E[] rest)
From source file:eu.numberfour.n4js.ui.workingsets.WorkingSetManager.java
/** * Sugar for {@link #unselect(Iterable)}. Marks the selected working sets to be invisible. * * @param first// w w w .ja va 2 s .c o m * the first working set to be marked as unselected. * @param others * other optional working sets to be marked as invisible. */ default void unselect(final WorkingSet first, final WorkingSet... others) { unselect(Lists.asList(first, others)); }
From source file:org.eclipse.che.ide.ext.github.client.authenticator.GitHubAuthenticatorImpl.java
private String getAuthUrl() { return OAuth2AuthenticatorUrlProvider.get(baseUrl, "github", appContext.getCurrentUser().getProfile().getUserId(), Lists.asList("user", new String[] { "repo", "write:public_key" })); }
From source file:com.notifier.desktop.transport.usb.impl.Adb.java
protected String runAdb(String... args) throws IOException, InterruptedException { ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.command(Lists.asList(getAdbPath(), args)); processBuilder.redirectErrorStream(true); final Process process = processBuilder.start(); String output = CharStreams.toString(new InputSupplier<BufferedReader>() { @Override/* w w w . j a v a 2 s.co m*/ public BufferedReader getInput() throws IOException { return new BufferedReader(new InputStreamReader(process.getInputStream())); } }); logger.trace("adb output:\n{}", output); int exitCode = process.waitFor(); if (exitCode != 0) { throw new IOException("adb returned error code: " + exitCode); } return output; }
From source file:com.google.gmail.provider.GMailMessageActivitySerializer.java
public static String formatId(String... idparts) { return Joiner.on(":").join(Lists.asList("id:gmail", idparts)); }
From source file:com.opengamma.strata.market.curve.CurveGroupDefinitionBuilder.java
/** * Adds the definition of a discount curve to the curve group definition. * <p>//from w w w . ja v a2 s . c o m * A curve added with this method cannot be calibrated by the market data system as it does not include * a curve definition. It is intended to be used with curves which are supplied by the user. * * @param curveName the name of the curve * @param otherCurrencies additional currencies for which the curve can provide discount factors * @param currency the currency for which the curve provides discount rates * @return this builder */ public CurveGroupDefinitionBuilder addDiscountCurve(CurveName curveName, Currency currency, Currency... otherCurrencies) { ArgChecker.notNull(curveName, "curveName"); ArgChecker.notNull(currency, "currency"); CurveGroupEntry entry = CurveGroupEntry.builder().curveName(curveName) .discountCurrencies(ImmutableSet.copyOf(Lists.asList(currency, otherCurrencies))).build(); return mergeEntry(entry); }
From source file:org.sonar.db.measure.MeasureDao.java
public void insert(DbSession session, MeasureDto item, MeasureDto... others) { insert(session, Lists.asList(item, others)); }
From source file:org.jboss.hal.ballroom.form.AbstractForm.java
protected void addFormItem(FormItem formItem, FormItem... formItems) { for (FormItem item : Lists.asList(formItem, formItems)) { this.formItems.put(item.getName(), item); item.setId(Ids.build(id, item.getName())); if (item instanceof AbstractFormItem) { ((AbstractFormItem) item).setForm(this); }//ww w . ja v a 2s. c o m } }
From source file:org.sonar.sslr.grammar.GrammarBuilder.java
/** * Creates parsing expression - "optional". * Convenience method equivalent to calling {@code optional(sequence(e, rest))}. * * @param e1 first sub-expression//from www . j av a 2 s . c om * @param rest rest of sub-expressions * @throws IllegalArgumentException if any of given arguments is not a parsing expression * @see #optional(Object) * @see #sequence(Object, Object) */ public final Object optional(Object e1, Object... rest) { return new OptionalExpression(new SequenceExpression(convertToExpressions(Lists.asList(e1, rest)))); }
From source file:org.apache.hadoop.hbase.security.access.TableAuthManager.java
/** * Returns a new {@code PermissionCache} initialized with permission assignments * from the {@code hbase.superuser} configuration key. */// www. java2 s .c o m private PermissionCache<Permission> initGlobal(Configuration conf) throws IOException { UserProvider userProvider = UserProvider.instantiate(conf); User user = userProvider.getCurrent(); if (user == null) { throw new IOException("Unable to obtain the current user, " + "authorization checks for internal operations will not work correctly!"); } PermissionCache<Permission> newCache = new PermissionCache<Permission>(); String currentUser = user.getShortName(); // the system user is always included List<String> superusers = Lists.asList(currentUser, conf.getStrings(AccessControlLists.SUPERUSER_CONF_KEY, new String[0])); if (superusers != null) { for (String name : superusers) { if (AccessControlLists.isGroupPrincipal(name)) { newCache.putGroup(AccessControlLists.getGroupName(name), new Permission(Permission.Action.values())); } else { newCache.putUser(name, new Permission(Permission.Action.values())); } } } return newCache; }
From source file:eu.numberfour.n4js.preferences.ExternalLibraryPreferenceModel.java
/** * Creates a new model instance with the given location arguments. * * @param firstLocation// w w w. ja v a2s .c o m * the external library folder location. * @param restLocations * other external library folder locations. */ public ExternalLibraryPreferenceModel(final URI firstLocation, final URI... restLocations) { this(Lists.asList(firstLocation, restLocations)); }