Example usage for java.util Collections unmodifiableSet

List of usage examples for java.util Collections unmodifiableSet

Introduction

In this page you can find the example usage for java.util Collections unmodifiableSet.

Prototype

public static <T> Set<T> unmodifiableSet(Set<? extends T> s) 

Source Link

Document

Returns an unmodifiable view of the specified set.

Usage

From source file:net.brtly.monkeyboard.plugin.core.PluginManager.java

/**
 * Return a set of plugin IDs that map to available plugins matching a list of filters.
 * If any given filter DOES NOT apply to a plugin, it is removed from the set.
 * @param filters//from  w w  w .j  a v  a2s. c  om
 * @return
 */
public Set<String> getPluginIDs(IPluginFilter... filters) {
    if (filters == null || filters.length == 0) {
        return Collections.unmodifiableSet(_plugins.keySet());
    }

    Set<String> rv;
    synchronized (_plugins) {
        rv = new HashSet<String>(_plugins.keySet());

        for (String id : _plugins.keySet()) {
            PluginLoader loader = getPluginLoader(id);
            if (loader == null) {
                rv.remove(id);
            } else {
                for (IPluginFilter filter : filters) {
                    if (!filter.appliesTo(loader)) {
                        rv.remove(id);
                    }
                }
            }
        }
    }
    return Collections.unmodifiableSet(rv);
}

From source file:org.web4thejob.web.panel.DefaultListViewPanel.java

@Override
public Set<CommandEnum> getSupportedCommands() {
    Set<CommandEnum> supported = new HashSet<CommandEnum>(super.getSupportedCommands());
    supported.add(CommandEnum.CONFIGURE_HEADERS);
    supported.add(CommandEnum.QUERY);// w  w w. ja v a 2  s . c om
    supported.add(CommandEnum.REFRESH);
    supported.add(CommandEnum.ADDNEW);
    supported.add(CommandEnum.UPDATE);
    supported.add(CommandEnum.DELETE);
    supported.add(CommandEnum.PRINT);
    supported.add(CommandEnum.RELATED_PANELS);
    return Collections.unmodifiableSet(supported);
}

From source file:de.kapsi.net.daap.Database.java

/**
 * Returns an unmodifiable Set with all deleted Playlists.
 * <p>NOTE: only valid during a {@see Transaction.commit()}
 * and always empty in the meantime.</p>
 * //from  ww  w .  j a  v  a2 s .com
 * @return unmodifiable Set of deleted Playlists
 */
public Set getDeletedPlaylists() {
    return Collections.unmodifiableSet(deletedContainers);
}

From source file:edu.vt.middleware.ldap.props.AbstractPropertyInvoker.java

/**
 * This returns the property keys.// w w  w .j ava  2  s.  c  o m
 *
 * @return  <code>Set</code> of property names
 */
public Set<String> getProperties() {
    return Collections.unmodifiableSet(this.properties.keySet());
}

From source file:org.web4thejob.web.panel.base.AbstractMutablePanel.java

@Override
public Set<CommandEnum> getSupportedCommands() {
    Set<CommandEnum> supported = new HashSet<CommandEnum>(super.getSupportedCommands());
    supported.add(CommandEnum.QUERY);//from w w  w .  j a  v a2  s . c  om
    supported.add(CommandEnum.REFRESH);
    supported.add(CommandEnum.ADDNEW);
    supported.add(CommandEnum.UPDATE);
    supported.add(CommandEnum.DELETE);
    supported.add(CommandEnum.PRINT);
    return Collections.unmodifiableSet(supported);
}

From source file:com.l2jserver.service.game.scripting.impl.ecj.EclipseCompilerScriptClassLoader.java

/**
 * {@inheritDoc}
 */
@Override
public Set<String> getLibraryClasses() {
    return Collections.unmodifiableSet(libraryClasses);
}

From source file:it.ecubecenter.processors.sentiment.SentimentAnalyzer.java

@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<>();
    descriptors.add(LANGUAGE_PROPERTY);// w w  w .j  a  v  a 2 s .c om
    descriptors.add(ATTRIBUTE_TO_ANALYZE_PROPERTY);
    this.descriptors = Collections.unmodifiableList(descriptors);

    final Set<Relationship> relationships = new HashSet<>();
    relationships.add(SUCCESS_RELATIONSHIP);
    relationships.add(FAILURE_RELATIONSHIP);
    this.relationships = Collections.unmodifiableSet(relationships);
}

From source file:com.valygard.aohruthless.framework.ArenaTemplate.java

@Override
public Set<Player> getPlayers() {
    Set<Player> result = new HashSet<>();
    result.addAll(specPlayers);/*from  w w  w . j ava 2s .c om*/
    result.addAll(arenaPlayers);
    result.addAll(lobbyPlayers);
    return Collections.unmodifiableSet(result);
}

From source file:com.thinkbiganalytics.nifi.v2.elasticsearch.IndexElasticSearch.java

/**
 * default constructor constructs the relationship and property collections
 *///from w  w w  . j  a  v a2s . c o  m
public IndexElasticSearch() {
    final Set<Relationship> r = new HashSet<>();
    r.add(REL_SUCCESS);
    r.add(REL_FAILURE);
    relationships = Collections.unmodifiableSet(r);

    final List<PropertyDescriptor> pds = new ArrayList<>();
    pds.add(INDEX_NAME);
    pds.add(TYPE);
    pds.add(HOST_NAME);
    pds.add(CLUSTER_NAME);
    pds.add(ID_FIELD);
    pds.add(CATEGORY_NAME);
    pds.add(FEED_NAME);
    propDescriptors = Collections.unmodifiableList(pds);
}

From source file:com.thinkbiganalytics.nifi.v2.ingest.CreateElasticsearchBackedHiveTable.java

/**
 * default constructor constructs the relationship and property collections
 *///from   www.  j ava  2s . c om
public CreateElasticsearchBackedHiveTable() {
    final Set<Relationship> r = new HashSet<>();
    r.add(IngestProperties.REL_SUCCESS);
    r.add(IngestProperties.REL_FAILURE);
    relationships = Collections.unmodifiableSet(r);

    final List<PropertyDescriptor> pds = new ArrayList<>();
    pds.add(NODES);
    pds.add(FEED_ROOT);
    pds.add(ID_FIELD);
    pds.add(FIELD_SPECIFICATION);
    pds.add(FEED_NAME);
    pds.add(FEED_CATEGORY);
    pds.add(THRIFT_SERVICE);
    pds.add(JAR_URL);
    pds.add(USE_WAN);
    pds.add(AUTO_CREATE_INDEX);
    pds.add(FIELD_INDEX_STRING);
    propDescriptors = Collections.unmodifiableList(pds);
}