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:fr.gouv.culture.thesaurus.service.rdf.RdfResource.java

/**
 * Returns all the values of the specified entry property.
 * // ww  w .j  ava2 s. c  om
 * @param key
 *            the URI.
 * @return the values of the property tagged with the specified language or
 *         an empty list if none is present.
 */
public Collection<LocalizedString> getProperties(String key) {
    return Collections.unmodifiableCollection(this.internalGetProperties(key));
}

From source file:de.uniba.wiai.kinf.pw.projects.lillytab.reasoner.tbox.AssertedRBox.java

@Override
public Collection<R> getRoles(RoleType type) {
    return Collections.unmodifiableCollection(_typeRoleMap.get(type));
}

From source file:de.uniba.wiai.kinf.pw.projects.lillytab.reasoner.tbox.RBox.java

@Override
public Collection<R> getSuperRoles(R role) {
    if (!hasRole(role)) {
        throw new IllegalArgumentException(String.format("Unknown role `%s'", role));
    }// ww  w  .  jav  a 2s  . c o  m

    final Collection<R> superRoles = _superRoles.get(role);
    if (superRoles != null) {
        return Collections.unmodifiableCollection(superRoles);
    } else {
        return null;
    }
}

From source file:hudson.model.View.java

/**
 * Gets all the items recursively contained in this collection in a read-only view.
 * <p>// w w  w .j a v a2  s .co m
 * The default implementation recursively adds the items of all contained Views
 * in case this view implements {@link ViewGroup}, which should be enough for most cases.
 *
 * @since 1.520
 */
public Collection<TopLevelItem> getAllItems() {

    if (this instanceof ViewGroup) {
        final Collection<TopLevelItem> items = new LinkedHashSet<TopLevelItem>(getItems());

        for (View view : ((ViewGroup) this).getViews()) {
            items.addAll(view.getAllItems());
        }
        return Collections.unmodifiableCollection(items);
    } else {
        return getItems();
    }
}

From source file:com.adito.activedirectory.ActiveDirectoryUserDatabaseConfiguration.java

private static Collection<String> getEscapedDns(Collection<String> toEscapeDns, boolean requiresSecondEscape) {
    Collection<String> escapedDns = new HashSet<String>(toEscapeDns.size());
    for (String toEscapeDn : toEscapeDns) {
        String escapedDn = getEscapedDn(toEscapeDn, requiresSecondEscape);
        escapedDns.add(escapedDn);// www .  ja va 2 s  .com
    }
    return Collections.unmodifiableCollection(escapedDns);
}

From source file:com.playersun.jbf.common.persistence.search.SearchRequest.java

@Override
public Collection<Condition> getConditions() {
    return Collections.unmodifiableCollection(conditions);
}

From source file:org.springframework.cloud.stream.config.BindingServiceConfiguration.java

@Bean
public CompositeMessageConverterFactory compositeMessageConverterFactory() {
    List<MessageConverter> messageConverters = new ArrayList<>();
    if (!CollectionUtils.isEmpty(this.customMessageConverters)) {
        messageConverters.addAll(Collections.unmodifiableCollection(this.customMessageConverters));
    }/*from  www  .  j  a va  2 s .c o  m*/
    return new CompositeMessageConverterFactory(messageConverters, this.objectMapper);
}

From source file:Cache.java

public synchronized Collection<V> values() {
    // First, clear all entries that have been in cache longer than the
    // maximum defined age.
    deleteExpiredEntries();/*  ww w . j a va 2s .  co  m*/

    return Collections.unmodifiableCollection(new AbstractCollection<V>() {
        Collection<CacheObject<V>> values = map.values();

        public Iterator<V> iterator() {
            return new Iterator<V>() {
                Iterator<CacheObject<V>> it = values.iterator();

                public boolean hasNext() {
                    return it.hasNext();
                }

                public V next() {
                    return it.next().object;
                }

                public void remove() {
                    it.remove();
                }
            };
        }

        public int size() {
            return values.size();
        }
    });
}

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

@Override
public Collection<TopicIF> getTopicTypes() {
    // Create new collection
    Collection<TopicIF> result = new ArrayList<TopicIF>(topics.keySet());
    result.remove(null);// w ww  .  ja v  a2  s. c  om
    return Collections.unmodifiableCollection(result);
}

From source file:edu.ksu.cis.indus.staticanalyses.impl.ClassHierarchy.java

/**
 * @see edu.ksu.cis.indus.interfaces.IClassHierarchy#getClasses()
 *///from  www  . ja  v  a2 s . co  m
public Collection<SootClass> getClasses() {
    return Collections.unmodifiableCollection(classes);
}