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:epgtools.libepgupdate.updator.config.Config.java

/**
 * Updater????//from   www. j  a  v  a  2s  . c  o  m
 *
 * @param connection ?DB??
 * @param xMLDirectory EPG XML???????
 * @param xMLFileCharCode EPG XML?
 * @param paidBroadcastings ?????????(??)
 */
public Config(java.sql.Connection connection, File xMLDirectory, Charset xMLFileCharCode,
        Set<Integer> paidBroadcastings) throws NullPointerException, IllegalArgumentException {
    if (connection != null) {
        this.connection = connection;
    } else {
        throw new NullPointerException("DB??????");
    }
    if (xMLDirectory != null && xMLDirectory.isDirectory()) {
        this.xMLDirectory = new File(xMLDirectory.getAbsolutePath());
    } else {
        throw new IllegalArgumentException(
                "XML??????????");
    }
    if (xMLFileCharCode != null) {
        this.xMLFileCharCode = xMLFileCharCode;
    } else {
        throw new NullPointerException("XML???????");
    }
    if (paidBroadcastings != null && paidBroadcastings.size() >= 0) {
        Set<Integer> tempPaidBroadcastings = new HashSet<>();
        tempPaidBroadcastings.addAll(paidBroadcastings);
        this.paidBroadcastings = Collections.unmodifiableSet(tempPaidBroadcastings);
    } else {
        throw new IllegalArgumentException(
                "?????????????");
    }
}

From source file:net.sourceforge.fenixedu.domain.phd.PhdElementsList.java

public Set<T> getTypes() {
    return Collections.unmodifiableSet(types);
}

From source file:eu.scidipes.toolkits.pawebapp.preservation.PreservationManagerImpl.java

@Override
public Set<PreservationJob> getPreservationJobs() {
    return Collections.unmodifiableSet(preservationJobs);
}

From source file:com.opengamma.engine.view.calc.LiveDataDeltaCalculator.java

public Set<DependencyNode> getChangedNodes() {
    if (!_done) {
        throw new IllegalStateException("Call computeDelta() first");
    }//from  w w w.j  a  v  a  2s. co m

    return Collections.unmodifiableSet(_changedNodes);
}

From source file:com.google.code.activetemplates.impl.handlers.BuiltinHandlerSPI.java

public Set<String> getExcludedNamespaces() {
    return Collections.unmodifiableSet(excludedNamespaces);
}

From source file:me.m1key.audiolicious.domain.entities.Library.java

public Set<Stat> getStats() {
    return Collections.unmodifiableSet(stats);
}

From source file:de.kaiserpfalzEdv.office.contacts.location.CityDO.java

@Override
public Set<PostCodeDO> getPostCodes() {
    return Collections.unmodifiableSet(postCodes);
}

From source file:de.javadesign.cdi.extension.spring.SpringBean.java

/**
 * Constructor.//w  ww  .  ja  v a2  s .  c o  m
 * 
 * @param beanName
 *            the bean name
 * @param beanClass
 *            the bean class
 * @param beanTypes
 *            the bean types
 * @param qualifiers
 *            the qualifiers
 * @param stereotypes
 *            the stereotypes
 * @param beanFactory
 *            the beanfactory
 */
public SpringBean(final String beanName, final Class<?> beanClass, final Set<Type> beanTypes,
        final Set<Annotation> qualifiers, final Set<Class<? extends Annotation>> stereotypes,
        final ConfigurableBeanFactory beanFactory) {
    this.beanName = beanName;
    this.beanClass = beanClass;
    this.beanTypes = Collections.unmodifiableSet(beanTypes);
    this.qualifiers = Collections.unmodifiableSet(qualifiers);
    this.stereotypes = Collections.unmodifiableSet(stereotypes);
    this.beanFactory = beanFactory;
}

From source file:org.brutusin.rpc.RpcUtils.java

public static Set<String> getUserRoles(Object securityContext) {
    Set<String> roleSet = new TreeSet<String>();
    if (securityContext != null) {
        SecurityContext sc = (SecurityContext) securityContext;
        Collection<? extends GrantedAuthority> authorities = sc.getAuthentication().getAuthorities();
        for (GrantedAuthority authority : authorities) {
            String auth = authority.getAuthority();
            if (auth.startsWith("ROLE_")) {
                auth = auth.substring(5);
            }/*from  w w w  .  java2  s . c o m*/
            roleSet.add(auth);
        }
    }
    return Collections.unmodifiableSet(roleSet);
}

From source file:de.xirp.io.Message.java

/**
 * Gets all the known keys of this message.
 * //w  w w .  ja  v a 2 s  . c  o  m
 * @return the keys used in this message
 */
public Set<String> getKeys() {
    return Collections.unmodifiableSet(dataMap.keySet());
}