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

/**
 * @return ?????//w  w w .j  av a2 s  .  co  m
 */
public synchronized Set<Integer> getPaidBroadcastings() {
    Set<Integer> tempPaidBroadcastings = new HashSet<>();
    tempPaidBroadcastings.addAll(paidBroadcastings);
    return Collections.unmodifiableSet(tempPaidBroadcastings);
}

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

@Override
public Set<CommandEnum> getSupportedCommands() {
    Set<CommandEnum> supported = new HashSet<CommandEnum>(super.getSupportedCommands());
    supported.add(CommandEnum.CONFIGURE_HEADERS);
    supported.add(CommandEnum.RELATED_PANELS);
    return Collections.unmodifiableSet(supported);
}

From source file:com.sysunite.weaver.nifi.GetXMLNodes.java

@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
    descriptors.add(PROP_XPATH);/*from  w  ww.  ja  va2  s  .  co m*/
    this.descriptors = Collections.unmodifiableList(descriptors);

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

From source file:com.google.gerrit.server.mail.SmtpEmailSender.java

@Inject
SmtpEmailSender(@GerritServerConfig final Config cfg) {
    enabled = cfg.getBoolean("sendemail", null, "enable", true);

    smtpHost = cfg.getString("sendemail", null, "smtpserver");
    if (smtpHost == null) {
        smtpHost = "127.0.0.1";
    }// ww  w . jav a2 s. c o m

    smtpEncryption = ConfigUtil.getEnum(cfg, "sendemail", null, "smtpencryption", Encryption.NONE);
    sslVerify = cfg.getBoolean("sendemail", null, "sslverify", true);

    final int defaultPort;
    switch (smtpEncryption) {
    case SSL:
        defaultPort = 465;
        break;

    case NONE:
    case TLS:
    default:
        defaultPort = 25;
        break;
    }
    smtpPort = cfg.getInt("sendemail", null, "smtpserverport", defaultPort);

    smtpUser = cfg.getString("sendemail", null, "smtpuser");
    smtpPass = cfg.getString("sendemail", null, "smtppass");

    Set<String> rcpt = new HashSet<String>();
    for (String addr : cfg.getStringList("sendemail", null, "allowrcpt")) {
        rcpt.add(addr);
    }
    allowrcpt = Collections.unmodifiableSet(rcpt);
    importance = cfg.getString("sendemail", null, "importance");
    expiryDays = cfg.getInt("sendemail", null, "expiryDays", 0);
}

From source file:com.streamsets.datacollector.classpath.ClasspathValidatorResult.java

private ClasspathValidatorResult(String name, Set<String> unparseablePaths,
        Map<String, Map<String, List<Dependency>>> versionCollisions) {
    this.name = name;
    this.unparseablePaths = Collections.unmodifiableSet(unparseablePaths);
    this.versionCollisions = Collections.unmodifiableMap(versionCollisions);
}

From source file:com.navercorp.pinpoint.common.server.util.AgentEventType.java

public Set<AgentEventTypeCategory> getCategory() {
    return Collections.unmodifiableSet(this.category);
}

From source file:com.opengamma.engine.view.calcnode.CalculationJobItem.java

/**
 * Returns the function input specifications. If the item has been deserialized the specifications will only be populated after {@link #resolveIdentifiers} has been called
 * //from ww w  . ja v  a  2s. co m
 * @return the input specifications or null if they have not been resolved
 */
public Set<ValueSpecification> getInputs() {
    return Collections.unmodifiableSet(_inputs);
}

From source file:org.jasig.portlet.survey.security.uportal.UPortalSecurityFilter.java

private void populateAuthorites(final RenderRequest req, final String principal) {

    // But the user's access has not yet been established...
    final Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>();

    boolean isSurveyAdmin = req.isUserInRole("survey-admin");
    if (isSurveyAdmin) {
        authorities.add(new SimpleGrantedAuthority(ROLE_ADMIN));
    }//from   www  .  j av  a2s .co  m

    boolean isSurveyUser = req.isUserInRole("survey-user");
    if (isSurveyUser) {
        authorities.add(new SimpleGrantedAuthority(ROLE_USER));
    }

    logger.debug("Setting up GrantedAutorities for user '{}' -- {}", principal, authorities.toString());

    final UPortalUserDetails userDetails = new UPortalUserDetails(principal,
            Collections.unmodifiableSet(authorities));

    // Add UserDetails to Session
    final PortletSession session = req.getPortletSession();
    session.setAttribute(AUTHENTICATION_TOKEN_KEY, userDetails, PortletSession.APPLICATION_SCOPE);
}

From source file:org.avidj.zuul.core.DefaultEmbeddedLockManager.java

@Override
public Set<Lock> getLocks(String id) {
    final Session session = sessions.get(id);
    if (session == null) {
        return Collections.emptySet();
    }//from  w  w w.  j  ava2s.c  o  m
    final Set<Lock> locks = new HashSet<>();
    for (LockTreeNode node : session.getLocks()) {
        Lock lock = node.getLock(id);
        if (lock != null) {
            locks.add(lock);
        }
    }
    return Collections.unmodifiableSet(locks);
}

From source file:org.n52.iceland.ogc.ows.OwsExtendedCapabilitiesProviderRepository.java

@Override
public Set<OwsExtendedCapabilitiesProviderKey> getKeys() {
    return Collections.unmodifiableSet(this.extendedCapabilitiesProvider.keySet());
}