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:org.web4thejob.web.panel.base.AbstractCommandAwarePanel.java

@Override
public Set<CommandEnum> getSupportedCommands() {
    Set<CommandEnum> supported = new HashSet<CommandEnum>(2);
    supported.add(CommandEnum.LOCALIZE);
    supported.add(CommandEnum.DESIGN);//w ww  . j  av  a 2s  .c  o  m
    return Collections.unmodifiableSet(supported);
}

From source file:org.apereo.services.persondir.support.jdbc.NamedParameterJdbcPersonAttributeDao.java

public void setAvailableQueryAttributes(final Set<String> availableQueryAttributes) {
    this.availableQueryAttributes = Collections.unmodifiableSet(availableQueryAttributes);
}

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

@Inject
SmtpEmailSender(@GerritServerConfig final Config cfg) {
    enabled = cfg.getBoolean("sendemail", null, "enable", true);
    connectTimeout = Ints.checkedCast(ConfigUtil.getTimeUnit(cfg, "sendemail", null, "connectTimeout",
            DEFAULT_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS));

    smtpHost = cfg.getString("sendemail", null, "smtpserver");
    if (smtpHost == null) {
        smtpHost = "127.0.0.1";
    }//from  w w w .  ja va  2  s .  c o  m

    smtpEncryption = cfg.getEnum("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<>();
    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:io.woolford.processors.nifibenford.BenfordsLaw.java

@Override
protected void init(final ProcessorInitializationContext context) {
    final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
    descriptors.add(ALPHA);/*ww w  .j ava2  s.c  o m*/
    descriptors.add(MIN_SAMPLE);
    this.descriptors = Collections.unmodifiableList(descriptors);

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

From source file:de.codesourcery.eve.skills.datamodel.Asset.java

public Set<CharacterID> getCharacterIds() {
    return Collections.unmodifiableSet(ownedByCharacterIds);
}

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

/**
 * Returns the function output specifications. If the item has been deserialized the specifications will only be populated after {@link #resolveIdentifiers} has been called.
 * //www.ja  v  a  2  s.c  o  m
 * @return the output specifications
 */
public Set<ValueSpecification> getOutputs() {
    return Collections.unmodifiableSet(_outputs);
}

From source file:com.opengamma.bbg.loader.SecurityLoader.java

/**
 * Loads a set of securities from Bloomberg specific keys.
 * @param bloombergKeys  the Bloomberg specific keys, not altered, not null
 * @return the set of securities, not null
 *//*from  www. j  a  v a  2  s  .c  o m*/
public Map<String, ManageableSecurity> loadSecurities(Set<String> bloombergKeys) {
    ArgumentChecker.notNull(bloombergKeys, "bloombergKeys");
    validateReferenceDataProvider();
    _logger.info("loading securities for {}", bloombergKeys);
    bloombergKeys = Collections.unmodifiableSet(bloombergKeys); // defensive unmodifiable
    Set<String> bbgFields = getBloombergFields(); // subclasses supply unmodifiable collection

    Map<String, ManageableSecurity> result = new HashMap<String, ManageableSecurity>();
    if (bloombergKeys.isEmpty()) {
        return result;
    }

    Map<String, FudgeMsg> refData = _referenceDataProvider.getReferenceData(bloombergKeys, bbgFields);
    for (String securityDes : bloombergKeys) {
        FudgeMsg fieldData = refData.get(securityDes);
        if (fieldData == null) {
            _logger.warn("No reference data for {} cannot be null", securityDes);
            continue;
        }
        // get field data
        ManageableSecurity security = createSecurity(fieldData);
        if (security != null) {
            result.put(securityDes, security);
        }
    }
    return result;
}

From source file:org.jasig.services.persondir.support.jdbc.NamedParameterJdbcPersonAttributeDao.java

@Required
public void setUserAttributeNames(Set<String> userAttributeNames) {
    this.userAttributeNames = Collections.unmodifiableSet(userAttributeNames);
}

From source file:com.buession.cas.service.persondir.support.jdbc.OAuthSingleRowJdbcPersonAttributeDao.java

public final Set<IPersonAttributes> getPeopleProvider(final ProviderId providerId) {
    Validate.notNull(providerId, "ProviderId may not be null.");
    Validate.notNull(providerId.getProviderName(), "Provider Name may not be null.");
    Validate.notNull(providerId.getId(), "Provider Id may not be null.");

    // Execute the query in the subclass
    final List<IPersonAttributes> unmappedPeople = getPeopleForQuery(providerId);
    if (unmappedPeople == null) {
        return null;
    }//from   w  w w  . j  a  va2 s . com

    // Map the attributes of the found people according to resultAttributeMapping if it is set
    final Set<IPersonAttributes> mappedPeople = new LinkedHashSet<IPersonAttributes>();
    for (final IPersonAttributes unmappedPerson : unmappedPeople) {
        final IPersonAttributes mappedPerson = this.mapPersonAttributes(unmappedPerson);
        mappedPeople.add(mappedPerson);
    }

    return Collections.unmodifiableSet(mappedPeople);
}

From source file:org.spring.cache.impl.MyMapCacheManager.java

@Override
public Collection<String> getCacheNames() {
    return Collections.unmodifiableSet(this.cacheMap.keySet());
}