Example usage for java.util Collections unmodifiableList

List of usage examples for java.util Collections unmodifiableList

Introduction

In this page you can find the example usage for java.util Collections unmodifiableList.

Prototype

public static <T> List<T> unmodifiableList(List<? extends T> list) 

Source Link

Document

Returns an unmodifiable view of the specified list.

Usage

From source file:net.dv8tion.jda.client.entities.impl.JDAClientImpl.java

@Override
public List<Group> getGroups() {
    return Collections.unmodifiableList(new ArrayList<>(groups.valueCollection()));
}

From source file:ch.rasc.wampspring.message.CallMessage.java

public CallMessage(JsonParser jp, WampSession wampSession) throws IOException {
    super(WampMessageType.CALL);

    if (jp.nextToken() != JsonToken.VALUE_STRING) {
        throw new IOException();
    }/*ww  w.  j a  va 2 s  .c o  m*/
    this.callID = jp.getValueAsString();

    if (jp.nextToken() != JsonToken.VALUE_STRING) {
        throw new IOException();
    }
    this.procURI = replacePrefix(jp.getValueAsString(), wampSession);

    List<Object> args = new ArrayList<>();
    while (jp.nextToken() != JsonToken.END_ARRAY) {
        args.add(jp.readValueAs(Object.class));
    }

    if (!args.isEmpty()) {
        this.arguments = Collections.unmodifiableList(args);
    } else {
        this.arguments = null;
    }
}

From source file:com.asakusafw.generator.HadoopBulkLoaderDDLGenerator.java

private static List<String> buildEnvProperties(String suffix) {
    assert suffix != null;
    List<String> properties = new ArrayList<String>(ENV_PREFIX.length);
    for (String prefix : ENV_PREFIX) {
        properties.add(prefix + suffix);
    }/*  w  w  w .j  a  va 2s  .co m*/
    return Collections.unmodifiableList(properties);
}

From source file:com.arpnetworking.clusteraggregator.configuration.EmitterConfiguration.java

public List<Sink> getSinks() {
    return Collections.unmodifiableList(_sinks);
}

From source file:com.github.fritaly.dualcommander.FileTableModel.java

public List<File> getAll() {
    return Collections.unmodifiableList(list);
}

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

private AccessToken(SignedJWT signedJwt) throws ParseException {
    super(TOKEN_CLASS, signedJwt);

    this.signedJwt = signedJwt;
    JWTClaimsSet claims = JWTUtils.getClaimsSet(this.signedJwt);

    String[] groupsStringArray = null;
    if (claims.getClaims().containsKey("groups")) {
        groupsStringArray = JWTUtils.getStringArray(claims, TOKEN_CLASS, "groups");
    }// w ww  .j  a  v a  2  s. c o m
    this.groups = (groupsStringArray == null) ? null
            : Collections.unmodifiableList(Arrays.asList(groupsStringArray));

    String adminServerRole = null;
    if (claims.getClaims().containsKey("admin_server_role")) {
        adminServerRole = JWTUtils.getString(claims, TOKEN_CLASS, "admin_server_role");
    }
    this.adminServerRole = adminServerRole;
}

From source file:hudson.plugins.sauce_ondemand.SauceOnDemandReport.java

public List<String> getIDs() {
    logger.fine("Retrieving Sauce job ids");
    List<String> ids = new ArrayList<String>();
    for (String[] sessionId : sessionIds) {
        ids.add(sessionId[0]);/*from   w  w  w .jav  a 2  s  .  co m*/
    }
    return Collections.unmodifiableList(ids);
}

From source file:com.blackbear.flatworm.Line.java

public List<LineElement> getElements() {
    return Collections.unmodifiableList(elements);
}

From source file:com.bazaarvoice.jolt.shiftr.spec.ShiftrLeafSpec.java

public ShiftrLeafSpec(String rawKey, Object rhs) {
    super(rawKey);

    List<ShiftrWriter> writers;
    if (rhs instanceof String) {
        // leaf level so spec is an dot notation write path
        writers = Arrays.asList(parseOutputDotNotation(rhs));
    } else if (rhs instanceof List) {
        // leaf level list
        // Spec : "foo": ["a", "b"] : Shift the value of "foo" to both "a" and "b"
        List<Object> rhsList = (List<Object>) rhs;
        writers = new ArrayList<ShiftrWriter>(rhsList.size());
        for (Object dotNotation : rhsList) {
            writers.add(parseOutputDotNotation(dotNotation));
        }/* w  w  w. java2 s .  c  o  m*/
    } else {
        throw new SpecException(
                "Invalid Shiftr spec RHS.  Should be map, string, or array of strings.  Spec in question : "
                        + rhs);
    }

    shiftrWriters = Collections.unmodifiableList(writers);
}