List of usage examples for java.util Collections unmodifiableSet
public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
From source file:com.haulmont.cuba.gui.presentations.PresentationsImpl.java
@Override public void commit() { if (!needToUpdate.isEmpty() || !needToRemove.isEmpty()) { DataService ds = AppBeans.get(DataService.NAME); CommitContext ctx = new CommitContext(Collections.unmodifiableSet(needToUpdate), Collections.unmodifiableSet(needToRemove)); Set<Entity> commitResult = ds.commit(ctx); commited(commitResult);/*from w ww . j a v a 2 s . c om*/ clearCommitList(); firePresentationsSetChanged(); } }
From source file:edu.vt.middleware.gator.server.SocketServer.java
/** * Gets an immutable set of logging engines configured for this server. * * @return Immutable set of available logging engines. *//*from w ww. j a v a 2s . c o m*/ public Set<LoggingEngine> getLoggingEngines() { return Collections.unmodifiableSet(loggingEngines); }
From source file:org.web4thejob.web.util.ToolbarRenderer.java
@Override public Set<CommandAware> getCommandOwners() { return Collections.unmodifiableSet(commandOwners); }
From source file:grails.plugins.jesque.AdminImpl.java
/** * {@inheritDoc} */ @Override public Set<String> getChannels() { return Collections.unmodifiableSet(this.channels); }
From source file:ddf.catalog.data.impl.MetacardTypeImpl.java
@Override public Set<AttributeDescriptor> getAttributeDescriptors() { return Collections.unmodifiableSet(new HashSet<>(descriptors.values())); }
From source file:io.fluo.core.impl.Environment.java
/** * read configuration from zookeeper/*from w w w . ja v a 2 s . c om*/ * * @throws InterruptedException * @throws KeeperException */ private void readConfig(CuratorFramework curator) throws Exception { accumuloInstance = new String(curator.getData().forPath(ZookeeperConstants.instanceNamePath(zoodir)), "UTF-8"); accumuloInstanceID = new String( curator.getData().forPath(ZookeeperConstants.accumuloInstanceIdPath(zoodir)), "UTF-8"); fluoInstanceID = new String(curator.getData().forPath(ZookeeperConstants.fluoInstanceIdPath(zoodir)), "UTF-8"); table = new String(curator.getData().forPath(ZookeeperConstants.tablePath(zoodir)), "UTF-8"); ByteArrayInputStream bais = new ByteArrayInputStream( curator.getData().forPath(ZookeeperConstants.observersPath(zoodir))); DataInputStream dis = new DataInputStream(bais); observers = Collections.unmodifiableMap(readObservers(dis)); weakObservers = Collections.unmodifiableMap(readObservers(dis)); allObserversColumns = new HashSet<>(); allObserversColumns.addAll(observers.keySet()); allObserversColumns.addAll(weakObservers.keySet()); allObserversColumns = Collections.unmodifiableSet(allObserversColumns); bais = new ByteArrayInputStream(curator.getData().forPath(ZookeeperConstants.sharedConfigPath(zoodir))); Properties sharedProps = new Properties(); sharedProps.load(bais); config.addConfiguration(ConfigurationConverter.getConfiguration(sharedProps)); }
From source file:edu.uci.ics.jung.graph.impl.SimpleSparseVertex.java
/** * @see edu.uci.ics.jung.graph.impl.AbstractSparseVertex#findEdgeSet(Vertex) *//*from w w w .ja v a 2 s. c o m*/ public Set findEdgeSet(Vertex v) { Set s = new HashSet(); Edge d = (Edge) getSuccsToOutEdges().get(v); Edge u = (Edge) getNeighborsToEdges().get(v); if (d != null) s.add(d); if (u != null) s.add(u); return Collections.unmodifiableSet(s); }
From source file:com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph.java
/** * Creates a {@link Neo4JGraph} instance with the given partition within the neo4j database. * * @param partition The {@link Neo4JReadPartition} within the neo4j database. * @param vertexLabels The set of labels to append to vertices created by the {@link Neo4JGraph} session. * @param driver The {@link Driver} instance with the database connection information. * @param vertexIdProvider The {@link Neo4JElementIdProvider} for the {@link Vertex} id generation. * @param edgeIdProvider The {@link Neo4JElementIdProvider} for the {@link Edge} id generation. *///from ww w . j a va2s . c o m public Neo4JGraph(Neo4JReadPartition partition, String[] vertexLabels, Driver driver, Neo4JElementIdProvider<?> vertexIdProvider, Neo4JElementIdProvider<?> edgeIdProvider) { Objects.requireNonNull(partition, "partition cannot be null"); Objects.requireNonNull(vertexLabels, "vertexLabels cannot be null"); Objects.requireNonNull(driver, "driver cannot be null"); Objects.requireNonNull(vertexIdProvider, "vertexIdProvider cannot be null"); Objects.requireNonNull(edgeIdProvider, "edgeIdProvider cannot be null"); // initialize fields this.partition = partition; this.vertexLabels = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(vertexLabels))); this.driver = driver; // validate partition & additional labels if (!partition.containsVertex(this.vertexLabels)) throw new IllegalArgumentException( "Invalid vertexLabels, vertices created by the graph will not be part of the given partition"); // store providers this.vertexIdProvider = vertexIdProvider; this.edgeIdProvider = edgeIdProvider; }
From source file:com.valygard.aohruthless.framework.ArenaTemplate.java
@Override public Set<Player> getSpectators() { return Collections.unmodifiableSet(specPlayers); }
From source file:gate.DocumentFormat.java
public static Set<String> getSupportedMimeTypes() { return Collections.unmodifiableSet(mimeString2mimeTypeMap.keySet()); }