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:org.shredzone.cilla.web.header.DocumentHeader.java

/**
 * Returns all {@link MetaTag} that have been added. The tags are returned sorted by
 * their name. Other {@link HeadTag} are not included.
 */// www  .  ja va 2  s.  co m
public Collection<MetaTag> getMetaTags() {
    return Collections.unmodifiableCollection(metaTags);
}

From source file:io.github.minime89.passbeam.keyboard.Keycode.java

public Keycode(@Attribute(name = "value", required = true) Integer value,
        @ElementList(inline = true, required = false) Collection<Keysym.Ref> keysymRefs) {
    this.value = value;
    this.keysymRefs = Collections.unmodifiableCollection(keysymRefs);
}

From source file:architecture.common.license.LicenseManager.java

public Collection<License.Module> getLicensedModules() {
    ArrayList<License.Module> list = new ArrayList<License.Module>();
    for (License.Module m : license.getModules()) {

        if (provider != null && provider.getInstalledModules().contains(m))
            list.add(m);/*from  w  ww  . jav  a2s  . c o  m*/
    }
    return Collections.unmodifiableCollection(list);
}

From source file:com.phoenixst.plexus.operations.Join.java

private void initialize() {
    Collection nodes = new CompositeCollection(left.nodes(null), right.nodes(null));
    nodeCollection = Collections.unmodifiableCollection(nodes);
    edgeCollection = new EdgeCollection();
}

From source file:org.cloudfoundry.identity.uaa.scim.bootstrap.ScimUserBootstrap.java

public ScimUserBootstrap(ScimUserProvisioning scimUserProvisioning, ScimGroupProvisioning scimGroupProvisioning,
        ScimGroupMembershipManager membershipManager, Collection<UaaUser> users) {
    Assert.notNull(scimUserProvisioning, "scimUserProvisioning cannot be null");
    Assert.notNull(scimGroupProvisioning, "scimGroupProvisioning cannont be null");
    Assert.notNull(membershipManager, "memberShipManager cannot be null");
    Assert.notNull(users, "users list cannot be null");
    this.scimUserProvisioning = scimUserProvisioning;
    this.scimGroupProvisioning = scimGroupProvisioning;
    this.membershipManager = membershipManager;
    this.users = Collections.unmodifiableCollection(users);
}

From source file:com.smartitengineering.util.opensearch.impl.UrlImpl.java

@Override
public Collection<Rel> getRels() {
    if (rels.isEmpty()) {
        return Collections.<Rel>singleton(new RelImpl(RelEnum.getDefault().getValue()));
    }/*  w w w . j a v a 2 s.  c o  m*/
    return Collections.unmodifiableCollection(rels);
}

From source file:com.smartitengineering.cms.client.impl.ContentsResourceImpl.java

@Override
public Collection<ContentResource> getContentResources() {
    if (getLastReadStateOfEntity() == null) {
        return Collections.emptyList();
    }//from w w w.j  av  a2s .  c  om
    final List<Entry> entries = getLastReadStateOfEntity().getEntries();
    if (entries == null || entries.isEmpty()) {
        return Collections.emptyList();
    }
    List<ContentResource> resources = new ArrayList<ContentResource>(entries.size());
    for (Entry entry : entries) {
        resources.add(new ContentResourceImpl(this,
                AtomClientUtil.convertFromAtomLinkToResourceLink(entry.getLink(Link.REL_ALTERNATE))));
    }
    return Collections.unmodifiableCollection(resources);
}

From source file:com.vmware.identity.openidconnect.protocol.AccessToken.java

public AccessToken(RSAPrivateKey privateKey, TokenType tokenType, JWTID jwtId, Issuer issuer, Subject subject,
        List<String> audience, Date issueTime,

        Date expirationTime, Scope scope, String tenant, ClientID clientId, SessionID sessionId,
        RSAPublicKey holderOfKey, Subject actAs, Nonce nonce,

        Collection<String> groups, String adminServerRole) throws JOSEException {
    super(TOKEN_CLASS, tokenType, jwtId, issuer, subject, audience, issueTime, expirationTime, scope, tenant,
            clientId, sessionId, holderOfKey, actAs, nonce);

    Validate.notNull(privateKey, "privateKey");

    this.groups = (groups == null) ? null : Collections.unmodifiableCollection(groups);
    this.adminServerRole = adminServerRole;

    JWTClaimsSet.Builder claimsBuilder = super.claimsBuilder();
    if (this.groups != null) {
        claimsBuilder = claimsBuilder.claim("groups", this.groups);
    }/* w  ww.  j ava  2  s.  c  o  m*/
    if (this.adminServerRole != null) {
        claimsBuilder = claimsBuilder.claim("admin_server_role", this.adminServerRole);
    }

    this.signedJwt = JWTUtils.signClaimsSet(claimsBuilder.build(), privateKey);
}

From source file:io.cloudex.framework.components.Context.java

/**
 * Resolve a value using a valueKey, valueKey starts with VARIABLE_PREFIX in the form #valueKey
 * @param valueKey - a key of a value //from   www.ja v a  2s  .c  o m
 * @return - the resolved value
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object resolveValue(final String valueKey) {

    Validate.notNull(valueKey, "valueKey is required");

    Object value = null;
    String key = resolveKey(valueKey);

    if (valueKey.equals(key)) {
        // nothing to resolve, just return it as it's
        value = valueKey;

    } else {

        // resolve from the Readonly first
        if (this.readOnly.keySet().contains(key)) {
            value = this.readOnly.get(key);

            if (value instanceof Collection) {
                value = Collections.unmodifiableCollection((Collection) value);
            }

        } else {
            value = this.context.get(key);
        }
    }

    return value;
}

From source file:me.st28.flexseries.flexcore.hook.HookManager.java

public Collection<Hook> getHooks() {
    return Collections.unmodifiableCollection(hooks.values());
}