Example usage for java.util Collections unmodifiableCollection

List of usage examples for java.util Collections unmodifiableCollection

Introduction

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

Prototype

public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c) 

Source Link

Document

Returns an unmodifiable view of the specified collection.

Usage

From source file:net.daboross.bukkitdev.skywars.kits.SkyKitConfiguration.java

@Override
public Collection<SkyKit> getAllKits() {
    return Collections.unmodifiableCollection(kits.values());
}

From source file:de.btobastian.javacord.ImplDiscordAPI.java

@Override
public Collection<Server> getServers() {
    return Collections.unmodifiableCollection(servers.values());
}

From source file:net.ontopia.topicmaps.impl.basic.index.ClassInstanceIndex.java

@Override
public Collection<TopicIF> getTopicNameTypes() {
    // Create new collection
    Collection<TopicIF> result = new ArrayList<TopicIF>(bnames.keySet());
    result.remove(null);/* w w  w. j a  v a2s.  com*/
    return Collections.unmodifiableCollection(result);
}

From source file:cl.ucn.disc.zoome.zui.layout.OrderedSparseGraph.java

public Collection<V> getNeighbors(V vertex) {
    if (!containsVertex(vertex))
        return null;
    // consider directed edges and undirected edges
    Collection<V> neighbors = new HashSet<V>(vertex_maps.get(vertex)[INCOMING].keySet());
    neighbors.addAll(vertex_maps.get(vertex)[OUTGOING].keySet());
    neighbors.addAll(vertex_maps.get(vertex)[INCIDENT].keySet());
    return Collections.unmodifiableCollection(neighbors);
}

From source file:grails.plugin.springsecurity.web.access.intercept.AbstractFilterInvocationDefinition.java

protected void compileAndStoreMapping(InterceptedUrl iu) {
    String pattern = iu.getPattern();
    HttpMethod method = iu.getHttpMethod();

    String key = pattern.toLowerCase();

    Collection<ConfigAttribute> configAttributes = iu.getConfigAttributes();

    InterceptedUrl replaced = storeMapping(key, method, Collections.unmodifiableCollection(configAttributes));
    if (replaced != null) {
        log.warn("replaced rule for '{}' with roles {} with roles {}",
                new Object[] { key, replaced.getConfigAttributes(), configAttributes });
    }/* w  w w .  ja  va 2 s.  co m*/
}

From source file:de.btobastian.javacord.ImplDiscordAPI.java

@Override
public Collection<Channel> getChannels() {
    Collection<Channel> channels = new ArrayList<>();
    for (Server server : getServers()) {
        channels.addAll(server.getChannels());
    }/*from   ww  w. j av  a2 s . c  o  m*/
    return Collections.unmodifiableCollection(channels);
}

From source file:fr.gouv.culture.thesaurus.service.rdf.RdfResource.java

/**
 * Retourne toutes les valeurs de type {@link Date} de la ressource pour la
 * proprit spcifie. Toute valeur incorrecte est ignore.
 * /* w w  w .  jav  a2 s  .  co  m*/
 * @param key
 *            URI de la proprit
 * @return Les valeurs de type {@link Date} de la proprit (ne peut tre
 *         <code>null</code>)
 */
public Collection<Date> getDateProperties(String key) {
    final Collection<LocalizedString> values = getProperties(key);
    final Collection<Date> dates = new ArrayList<Date>(values.size());
    for (final LocalizedString value : values) {
        final Date parsedDate = parseXmlDate(value.getValue());
        if (parsedDate != null) {
            dates.add(parsedDate);
        }
    }
    return Collections.unmodifiableCollection(dates);
}

From source file:com.pongasoft.kiwidoc.model.ClassModel.java

/**
 * @return all the fields
 */
public Collection<FieldModel> getAllFields() {
    return Collections.unmodifiableCollection(_fields.values());
}

From source file:org.alfresco.opencmis.dictionary.CMISDictionaryRegistryImpl.java

@Override
public Collection<AbstractTypeDefinitionWrapper> getTypeDefs(boolean includeParent) {
    Collection<AbstractTypeDefinitionWrapper> ret = new LinkedList<>();
    ret.addAll(getTypeDefsImpl());// www .  j  a va  2 s.c o m
    if (includeParent && getParent() != null) {
        ret.addAll(getParent().getTypeDefs());
    }
    return Collections.unmodifiableCollection(ret);
}

From source file:io.github.gsteckman.rpi_rest.SubscriptionManager.java

/**
 * Returns the SubscriptionInfo for all subscribers to the specified key/resource.
 * //from www . j  av  a  2 s.  c  o m
 * @param key
 *            Identifies the resource for which subscribers are to be returned.
 * @return A collection of the subscription information.
 */
public Collection<SubscriptionInfo> getSubscriptions(final String key) {
    if (subscriptions.get(key) != null) {
        return Collections.unmodifiableCollection(subscriptions.get(key).values());
    }
    return new ArrayList<SubscriptionInfo>();
}