Example usage for com.google.common.collect ImmutableSet of

List of usage examples for com.google.common.collect ImmutableSet of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSet of.

Prototype

@SuppressWarnings("unchecked")
    public static <E> ImmutableSet<E> of(E e1, E e2, E e3, E e4) 

Source Link

Usage

From source file:org.eclipse.che.util.GwtXmlGenerator.java

/**
 * Generated consolidated gwt.xml based on exists XX.gwt.xml in class path
 *
 * @param args/* w w w  .j  a  v a 2s  .c o m*/
 *         possible arguments
 *         --rootDir - directory where gwt.xml file will be generated, default "."
 *         --gwtFileName - Name of the generated file in rootDir, default "org/eclipse/che/ide/IDE.gwt.xml"
 *         --entryPoint - gwt xml entry point, default "org.eclipse.che.ide.client.IDE"
 *         --styleSheet - gwt xml stylesheet, default "IDE.css"
 *         --loggingEnabled - Enable or disable gwt logging, default "false"
 *         --includePackages - Include only specific packages where *.gwt.xml can be found, default "No value. Means all packages"
 *         --excludePackages - Exclude packages from *.gwt.xml scanning   , default "com.google", "elemental","java.util","java.lang"
 */
public static void main(String[] args) {

    try {
        System.out.println(" ------------------------------------------------------------------------ ");
        System.out.println("Searching for GWT");
        System.out.println(" ------------------------------------------------------------------------ ");
        Map<String, Set<String>> parsedArgs = GeneratorUtils.parseArgs(args);

        GwtXmlModuleSearcher searcher = new GwtXmlModuleSearcher(
                parsedArgs.getOrDefault("excludePackages",
                        ImmutableSet.of("com.google", "elemental", "java.util", "java.lang")),
                parsedArgs.getOrDefault("includePackages", Collections.emptySet()), Collections.emptySet());
        Set<String> gwtModules = searcher.getGwtModulesFromClassPath();
        gwtModules.forEach(System.out::println);
        System.out.println("Found " + gwtModules.size() + " gwt modules");

        GwtXmlGeneratorConfig gwtXmlGeneratorConfig = new GwtXmlGeneratorConfig(gwtModules,
                new File(getSingleValueOrDefault(parsedArgs, "rootDir", ".")),
                getSingleValueOrDefault(parsedArgs, "gwtFileName", DEFAULT_GWT_XML_PATH),
                getSingleValueOrDefault(parsedArgs, "entryPoint", DEFAULT_GWT_ETNRY_POINT),
                getSingleValueOrDefault(parsedArgs, "styleSheet", DEFAULT_STYLE_SHEET), parseBoolean(
                        getSingleValueOrDefault(parsedArgs, "loggingEnabled", DEFAULT_LOGGING.toString())));
        GwtXmlGenerator gwtXmlGenerator = new GwtXmlGenerator(gwtXmlGeneratorConfig);
        gwtXmlGenerator.generateGwtXml();
    } catch (IOException e) {
        System.err.println(e.getMessage());
        // error
        System.exit(1);//NOSONAR
    }
}

From source file:com.facebook.buck.js.ReactNativeFlavors.java

public static boolean validateFlavors(ImmutableSet<Flavor> flavors) {
    return ImmutableSet.of(DEV, UNBUNDLE, INDEXED_UNBUNDLE, SOURCE_MAP).containsAll(flavors);
}

From source file:com.nesscomputing.jdbc.wrappers.ClientInfoWrapper.java

public ClientInfoWrapper() throws NoSuchMethodException {
    super(ImmutableSet.of(Connection.class.getMethod("getClientInfo", new Class<?>[] { String.class }),
            Connection.class.getMethod("getClientInfo", new Class<?>[0]),
            Connection.class.getMethod("setClientInfo", new Class<?>[] { String.class, String.class }),
            Connection.class.getMethod("setClientInfo", new Class<?>[] { Properties.class })));
}

From source file:dagger.spi.FailingPlugin.java

@Override
public Set<String> supportedOptions() {
    return ImmutableSet.of("error_on_binding", "error_on_dependency", "error_on_component",
            "error_on_subcomponents");
}

From source file:com.linecorp.armeria.common.grpc.GrpcSerializationFormatProvider.java

@Override
protected Set<Entry> entries() {
    return ImmutableSet.of(
            new Entry("gproto", create("application", "grpc+proto"), create("application", "grpc")),
            new Entry("gjson", create("application", "grpc+json")),
            new Entry("gproto-web", create("application", "grpc-web+proto"), create("application", "grpc-web")),
            new Entry("gjson-web", create("application", "grpc-web+json")));
}

From source file:com.linecorp.armeria.common.thrift.ThriftSerializationFormatProvider.java

@Override
protected Set<Entry> entries() {
    return ImmutableSet.of(
            new Entry("tbinary", create("x-thrift", "TBINARY"), create("vnd.apache.thrift.binary")),
            new Entry("tcompact", create("x-thrift", "TCOMPACT"), create("vnd.apache.thrift.compact")),
            new Entry("tjson", create("x-thrift", "TJSON"), create("x-thrift", "TJSON").withCharset(UTF_8),
                    create("vnd.apache.thrift.json"), create("vnd.apache.thrift.json").withCharset(UTF_8)),
            new Entry("ttext", create("x-thrift", "TTEXT"), create("x-thrift", "TTEXT").withCharset(UTF_8),
                    create("vnd.apache.thrift.text"), create("vnd.apache.thrift.text").withCharset(UTF_8)));
}

From source file:com.metamx.tranquility.kafka.model.PropertiesBasedKafkaConfig.java

public PropertiesBasedKafkaConfig() {
    super(ImmutableSet.of("kafka.group.id", "kafka.zookeeper.connect", "consumer.numThreads",
            "commit.periodMillis"));
}

From source file:ollie.internal.codegen.OllieProcessor.java

@Override
public Set<String> getSupportedAnnotationTypes() {
    return ImmutableSet.of(Migration.class.getName(), TypeAdapter.class.getName(), Table.class.getName(),
            Column.class.getName());
}