List of usage examples for com.google.common.collect ImmutableSet of
@SuppressWarnings({ "unchecked" }) public static <E> ImmutableSet<E> of()
From source file:ealvatag.tag.NullTag.java
@Override public ImmutableSet<FieldKey> getSupportedFields() { return ImmutableSet.of(); }
From source file:de.metas.ui.web.view.json.JSONDocumentIdsSelection.java
private JSONDocumentIdsSelection(@JsonProperty("selection") final Set<String> selection) { this.selection = selection == null ? ImmutableSet.of() : ImmutableSet.copyOf(selection); }
From source file:com.facebook.presto.server.PluginDiscovery.java
public static Set<String> discoverPlugins(Artifact artifact, ClassLoader classLoader) throws IOException { if (!artifact.getExtension().equals("presto-plugin")) { throw new RuntimeException("Unexpected extension for main artifact: " + artifact); }/*from ww w . j ava 2s . c o m*/ File file = artifact.getFile(); if (!file.getPath().endsWith("/target/classes")) { throw new RuntimeException("Unexpected file for main artifact: " + file); } if (!file.isDirectory()) { throw new RuntimeException("Main artifact file is not a directory: " + file); } if (new File(file, SERVICES_FILE).exists()) { return ImmutableSet.of(); } return listClasses(file.toPath()).stream() .filter(name -> classInterfaces(name, classLoader).contains(Plugin.class.getName())) .collect(toImmutableSet()); }
From source file:com.facebook.presto.kafka.MetastoreModule.java
@Override public void configure(Binder binder) { configBinder(binder).bindConfig(JDBCConfig.class, Names.named("presto.metastore.jdbc"), "presto.metastore.jdbc"); binder.bind(EventBus.class).in(Scopes.SINGLETON); binder.bind(FieldDependencyBuilder.FieldDependency.class) .toInstance(new FieldDependencyBuilder.FieldDependency(ImmutableSet.of(), ImmutableMap.of())); binder.bind(Metastore.class).to(JDBCMetastore.class).in(Scopes.SINGLETON); configBinder(binder).bindConfig(PrestoConfig.class); }
From source file:com.facebook.buck.core.model.targetgraph.impl.TargetGraphAndTargets.java
public static TargetGraphAndTargets create(ImmutableSet<BuildTarget> graphRoots, TargetGraph projectGraph, boolean isWithTests, ImmutableSet<BuildTarget> explicitTests) { // Get the roots of the main graph. This contains all the targets in the project slice, or all // the valid project roots if a project slice is not specified. Iterable<TargetNode<?>> projectRoots = projectGraph.getAll(graphRoots); // Optionally get the roots of the test graph. This contains all the tests that cover the roots // of the main graph or their dependencies. Iterable<TargetNode<?>> associatedTests = ImmutableSet.of(); if (isWithTests) { associatedTests = projectGraph.getAll(explicitTests); }//from w w w.j a v a 2s . c o m TargetGraph targetGraph = projectGraph.getSubgraph(Iterables.concat(projectRoots, associatedTests)); return new TargetGraphAndTargets(targetGraph, projectRoots); }
From source file:org.opendaylight.yangtools.yang.data.util.EmptyConstraintDefinition.java
@Override public final Set<MustDefinition> getMustConstraints() { return ImmutableSet.of(); }
From source file:com.spotify.missinglink.Simple.java
/** * Empty new DeclaredClass, all collections filled in with empty values * @param className//from w w w. ja v a 2 s.com * @return */ public static DeclaredClassBuilder newClass(String className) { return new DeclaredClassBuilder().className(TypeDescriptors.fromClassName(className)) .parents(ImmutableSet.of()).loadedClasses(ImmutableSet.of()).methods(ImmutableMap.of()) .fields(ImmutableSet.<DeclaredField>of()); }