List of usage examples for com.google.common.collect ImmutableList of
public static <E> ImmutableList<E> of(E e1, E e2)
From source file:io.crate.operation.operator.any.AnyEqOperator.java
public static FunctionInfo createInfo(DataType targetType) { return new FunctionInfo(new FunctionIdent(NAME, ImmutableList.of(targetType, new SetType(targetType))), DataTypes.BOOLEAN);//from w w w . jav a 2s . c o m }
From source file:com.querydsl.core.types.expr.NumberOperation.java
public static <D extends Number & Comparable<?>> NumberExpression<D> create(Class<? extends D> type, Operator<? super D> op, Expression<?> one, Expression<?> two) { return new NumberOperation<D>(type, op, ImmutableList.of(one, two)); }
From source file:com.mysema.query.types.template.BooleanTemplate.java
public static BooleanExpression create(String template, Object one, Object two) { return new BooleanTemplate(TemplateFactory.DEFAULT.create(template), ImmutableList.of(one, two)); }
From source file:com.querydsl.core.types.template.StringTemplate.java
public static StringExpression create(String template, Object one, Object two) { return new StringTemplate(TemplateFactory.DEFAULT.create(template), ImmutableList.of(one, two)); }
From source file:com.mysema.query.types.TemplateExpressionImpl.java
public static <C> Expression<C> create(Class<C> cl, String template, Object one, Object two) { return new TemplateExpressionImpl<C>(cl, TemplateFactory.DEFAULT.create(template), ImmutableList.of(one, two)); }
From source file:com.spotify.heroic.jetty.JettyServerConnector.java
public static List<JettyConnectionFactory.Builder> defaultFactories() { return ImmutableList.of(HttpJettyConnectionFactory.builder(), Http2CJettyConnectionFactory.builder()); }
From source file:org.sonar.plugins.scm.tfs.TfsConfiguration.java
public static List<PropertyDefinition> getProperties() { return ImmutableList.of( PropertyDefinition.builder(USERNAME_PROPERTY_KEY).name("Username") .description("Username to be used for TFS authentication").type(PropertyType.STRING) .onQualifiers(Qualifiers.PROJECT).category(CoreProperties.CATEGORY_SCM) .subCategory(CATEGORY).index(0).build(), PropertyDefinition.builder(PASSWORD_PROPERTY_KEY).name("Password") .description("Password to be used for TFS authentication").type(PropertyType.PASSWORD) .onQualifiers(Qualifiers.PROJECT).category(CoreProperties.CATEGORY_SCM) .subCategory(CATEGORY).index(1).build()); }
From source file:org.gradle.launcher.daemon.server.DaemonExpirationStrategies.java
public static DaemonExpirationStrategy getDefaultStrategy(Daemon daemon, DaemonServices daemonServices, final DaemonServerConfiguration params) { ImmutableList.Builder<DaemonExpirationStrategy> strategies = ImmutableList .<DaemonExpirationStrategy>builder(); strategies.add(getHealthStrategy(daemonServices.get(DaemonHealthServices.class).getDaemonStatus())); strategies.add(/*from w ww .j a va 2s. c om*/ new DaemonIdleTimeoutExpirationStrategy(daemon, params.getIdleTimeout(), TimeUnit.MILLISECONDS)); try { strategies .add(new AllDaemonExpirationStrategy(ImmutableList.of( new DaemonIdleTimeoutExpirationStrategy(daemon, params.getIdleTimeout() / 8, TimeUnit.MILLISECONDS), LowMemoryDaemonExpirationStrategy.belowFreePercentage(0.2)))); } catch (UnsupportedOperationException e) { logger.info("This JVM does not support getting free system memory, so daemons will not check for it"); } strategies.add(new DaemonRegistryUnavailableExpirationStrategy(daemon)); return new AnyDaemonExpirationStrategy(strategies.build()); }
From source file:com.linecorp.armeria.client.http.encoding.HttpDecodingClient.java
/** * Creates a new {@link HttpDecodingClient} decorator with the default encodings of 'gzip' and 'deflate'. *//*from w w w. j av a2s. com*/ public static Function<Client<HttpRequest, HttpResponse>, HttpDecodingClient> newDecorator() { return newDecorator(ImmutableList.of(new GzipStreamDecoderFactory(), new DeflateStreamDecoderFactory())); }
From source file:org.sonar.jproperties.its.ProfileGenerator.java
public static void generateProfile(Orchestrator orchestrator) { List<String> repositories = ImmutableList.of("jproperties", "sonarscanner"); try {//from www. j a v a 2 s . c o m StringBuilder sb = new StringBuilder().append("<profile>").append("<name>rules</name>") .append("<language>jproperties</language>").append("<rules>"); for (String repository : repositories) { Set<String> ruleKeys = getRuleKeysFromRepository(repository, orchestrator); for (String key : ruleKeys) { sb.append("<rule>").append("<repositoryKey>").append(repository).append("</repositoryKey>") .append("<key>").append(key).append("</key>").append("<priority>INFO</priority>"); Collection<Parameter> parameters = ProfileGenerator.parameters.get(key); if (!parameters.isEmpty()) { sb.append("<parameters>"); for (Parameter parameter : parameters) { sb.append("<parameter>").append("<key>").append(parameter.parameterKey).append("</key>") .append("<value>").append(parameter.parameterValue).append("</value>") .append("</parameter>"); } sb.append("</parameters>"); } sb.append("</rule>"); } } sb.append("</rules>").append("</profile>"); File file = File.createTempFile("profile", ".xml"); Files.write(sb, file, Charsets.UTF_8); orchestrator.getServer().restoreProfile(FileLocation.of(file)); file.delete(); } catch (IOException e) { throw Throwables.propagate(e); } }