java.util.Collections#unmodifiableSet ( )源码实例Demo

下面列出了java.util.Collections#unmodifiableSet ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: orianna   文件: Mastery.java
@Override
public Set<String> get() {
    if(coreData.getIncludedData() == null) {
        return null;
    }
    return Collections.unmodifiableSet(coreData.getIncludedData());
}
 
public DefaultCacheMethodDetails(Method method, A cacheAnnotation, String cacheName) {
	this.method = method;
	this.annotations = Collections.unmodifiableSet(
			new LinkedHashSet<Annotation>(asList(method.getAnnotations())));
	this.cacheAnnotation = cacheAnnotation;
	this.cacheName = cacheName;
}
 
源代码3 项目: wildfly-core   文件: DomainHostExcludeRegistry.java
private VersionExcludeData(Set<String> excludedExtensions, Set<String> activeServerGroups, Set<String> activeSocketBindingGroups) {
    this.excludedExtensions = excludedExtensions == null
            ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet<>(excludedExtensions));
    this.activeServerGroups = activeServerGroups == null
            ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet<>(activeServerGroups));
    this.activeSocketBindingGroups = activeSocketBindingGroups == null
            ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet<>(activeSocketBindingGroups));
}
 
private MasterRegistrationControlEntry mapEntityToJoynrType(MasterRegistrationControlEntryEntity entity) {
    Set<TrustLevel> possibleRequiredTrustLevels = Collections.unmodifiableSet(entity.getPossibleRequiredTrustLevels());
    Set<TrustLevel> possibleRequiredControlEntryChangeTrustLevels = Collections.unmodifiableSet(entity.getPossibleRequiredControlEntryChangeTrustLevels());
    Set<Permission> possibleProviderPermissions = new HashSet<>(Arrays.asList(entity.getDefaultProviderPermission()));
    MasterRegistrationControlEntry entry = new MasterRegistrationControlEntry(entity.getUserId(),
                                                                              entity.getDomain(),
                                                                              entity.getInterfaceName(),
                                                                              entity.getDefaultRequiredTrustLevel(),
                                                                              possibleRequiredTrustLevels.toArray(new TrustLevel[possibleRequiredTrustLevels.size()]),
                                                                              entity.getDefaultRequiredControlEntryChangeTrustLevel(),
                                                                              possibleRequiredControlEntryChangeTrustLevels.toArray(new TrustLevel[possibleRequiredControlEntryChangeTrustLevels.size()]),
                                                                              entity.getDefaultProviderPermission(),
                                                                              possibleProviderPermissions.toArray(new Permission[possibleProviderPermissions.size()]));
    return entry;
}
 
源代码5 项目: vespa   文件: RoutingController.java
/**
 * Register endpoints for rotations assigned to given application and zone in DNS.
 *
 * @return the registered endpoints
 */
public Set<ContainerEndpoint> registerEndpointsInDns(Application application, InstanceName instanceName, ZoneId zone) {
    var instance = application.require(instanceName);
    var containerEndpoints = new HashSet<ContainerEndpoint>();
    boolean registerLegacyNames = application.deploymentSpec().instance(instanceName)
                                             .flatMap(DeploymentInstanceSpec::globalServiceId)
                                             .isPresent();
    for (var assignedRotation : instance.rotations()) {
        var names = new ArrayList<String>();
        var endpoints = endpointsOf(application, instanceName).named(assignedRotation.endpointId())
                                                              .requiresRotation();

        // Skip rotations which do not apply to this zone. Legacy names always point to all zones
        if (!registerLegacyNames && !assignedRotation.regions().contains(zone.region())) {
            continue;
        }

        // Omit legacy DNS names when assigning rotations using <endpoints/> syntax
        if (!registerLegacyNames) {
            endpoints = endpoints.not().legacy();
        }

        // Register names in DNS
        var rotation = rotationRepository.getRotation(assignedRotation.rotationId());
        if (rotation.isPresent()) {
            endpoints.forEach(endpoint -> {
                controller.nameServiceForwarder().createCname(RecordName.from(endpoint.dnsName()),
                                                              RecordData.fqdn(rotation.get().name()),
                                                              Priority.normal);
                names.add(endpoint.dnsName());
            });
        }

        // Include rotation ID as a valid name of this container endpoint (required by global routing health checks)
        names.add(assignedRotation.rotationId().asString());
        containerEndpoints.add(new ContainerEndpoint(assignedRotation.clusterId().value(), names));
    }
    return Collections.unmodifiableSet(containerEndpoints);
}
 
源代码6 项目: netbeans   文件: TokenFactories.java
@Override
public Set<QName> getElementQNames() {
   HashSet<QName> set = new HashSet<QName>();
    for (ConfigVersion cfgVersion : ConfigVersion.values()) {
        set.add(SecurityPolicyQName.ISSUER.getQName(cfgVersion));
    }
    return Collections.unmodifiableSet(set);
}
 
源代码7 项目: java-jaxrs   文件: InstrumentedRestApplication.java
@Override
public Set<Object> getSingletons() {
    Set<Object> objects = new HashSet<>();

    objects.add(serverTracingFeature);
    objects.add(new TestHandler(tracer, client));
    objects.add(new DisabledTestHandler(tracer));
    objects.add(new ServicesImpl());
    objects.add(new ServicesImplOverrideClassPath());
    objects.add(new ServicesImplOverrideMethodPath());
    objects.add(new DenyFilteredFeature());
    objects.add(new MappedExceptionMapper());

    return Collections.unmodifiableSet(objects);
}
 
源代码8 项目: ldp4j   文件: InMemoryResource.java
/**
 * {@inheritDoc}
 */
@Override
public Set<InMemoryAttachment> attachments() {
	return Collections.unmodifiableSet(new LinkedHashSet<InMemoryAttachment>(this.attachments.values()));
}
 
源代码9 项目: ldp4j   文件: Namespaces.java
public Set<String> getDeclaredPrefixes() {
	return Collections.unmodifiableSet(map.keySet());
}
 
源代码10 项目: swellrt   文件: OpBasedBlip.java
@Override
public Set<ParticipantId> getContributorIds() {
  return Collections.unmodifiableSet(blip.getContributors());
}
 
源代码11 项目: tokens   文件: AccessTokenConfiguration.java
Set<Object> getScopes() {
	return Collections.unmodifiableSet(scopes);
}
 
源代码12 项目: elk-reasoner   文件: IndividualNode.java
@Override
public Set<? extends TN> getDirectTypeNodes() {
	return Collections.unmodifiableSet(toTypeNodes(directTypeNodes_));
}
 
源代码13 项目: amodeus   文件: Nodes.java
public Set<Integer> getNodes() {
    return Collections.unmodifiableSet(nodes);
}
 
@Override
public Set<DecoderKey> getKeys() {
    return Collections.unmodifiableSet(DECODER_KEYS);
}
 
源代码15 项目: jersey-jwt   文件: AuthenticationTokenDetails.java
public Builder withAuthorities(Set<Authority> authorities) {
    this.authorities = Collections.unmodifiableSet(authorities == null ? new HashSet<>() : authorities);
    return this;
}
 
源代码16 项目: Box   文件: LoopInfo.java
public LoopInfo(BlockNode start, BlockNode end) {
	this.start = start;
	this.end = end;
	this.loopBlocks = Collections.unmodifiableSet(BlockUtils.getAllPathsBlocks(start, end));
}
 
/**
 * <p>
 * Returns a set with the names of all child configuration builders. A tag
 * defining a configuration source in the configuration definition file can
 * have the {@code config-name} attribute. If this attribute is present, the
 * corresponding builder is assigned this name and can be directly accessed
 * through the {@link #getNamedBuilder(String)} method. This method returns
 * a collection with all available builder names.
 * </p>
 * <p>
 * <strong>Important note:</strong> This method only returns a meaningful
 * result after the result configuration has been created by calling
 * {@code getConfiguration()}. If called before, always an empty set is
 * returned.
 * </p>
 *
 * @return a set with the names of all builders
 */
public synchronized Set<String> builderNames()
{
    if (sourceData == null)
    {
        return Collections.emptySet();
    }
    return Collections.unmodifiableSet(sourceData.builderNames());
}
 
源代码18 项目: ripple-lib-java   文件: ExtendedPKIXParameters.java
/**
 * Returns the neccessary attributes which must be contained in an attribute
 * certificate.
 * <p>
 * The returned <code>Set</code> is immutable and contains
 * <code>String</code>s with the OIDs.
 * 
 * @return Returns the necessary AC attributes.
 */
public Set getNecessaryACAttributes()
{
    return Collections.unmodifiableSet(necessaryACAttributes);
}
 
源代码19 项目: jasperreports   文件: JRExpressionCollector.java
/**
 * Return all the expressions collected from the report.
 * 
 * @return all the expressions collected from the report
 */
public Collection<JRExpression> getReportExpressions()
{
	return Collections.unmodifiableSet(expressionIds.keySet());
}
 
/**
 * Get the deletions
 * 
 * @return - the ids to delete
 */
public Set<String> getDeletions()
{
    return Collections.unmodifiableSet(deletions);
}