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.sourceforge.eclipsetrader.ats.Repository.java

public List allTradingSystems() {
    return Collections.unmodifiableList(systems);
}

From source file:org.fedoraproject.jenkins.plugins.fedmsgtrigger.FedmsgTrigger.java

public List<MsgCheck> getChecks() {
    return Collections.unmodifiableList(checks);
}

From source file:edu.umich.flowfence.common.QMDetails.java

public void readFromParcel(Parcel source) {
    final int length = source.readInt();
    final int endPos = source.dataPosition() + length;

    if (localLOGV) {
        Log.v(TAG, "Unparceling, length " + length);
    }/*ww  w.j a v a2  s  .  c o m*/

    if (source.dataPosition() < endPos) {
        descriptor = QMDescriptor.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Descriptor: " + descriptor);
        }
    }
    if (source.dataPosition() < endPos) {
        resultType = source.readString();
        if (localLOGV) {
            Log.v(TAG, "Result type: " + resultType);
        }
    }
    if (source.dataPosition() < endPos) {
        paramInfo = source.createTypedArrayList(ParamInfo.CREATOR);
        if (paramInfo != null) {
            if (localLOGV) {
                Log.v(TAG, "Param info (size " + paramInfo.size() + "):");
                for (ParamInfo pi : paramInfo) {
                    Log.v(TAG, "    " + pi);
                }
            }
            paramInfo = Collections.unmodifiableList(paramInfo);
        } else if (localLOGV) {
            Log.v(TAG, "Param info (null)");
        }
    }
    if (source.dataPosition() < endPos) {
        requiredTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Required taints: " + requiredTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        optionalTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Optional taints: " + optionalTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        if (localLOGD) {
            Log.d(TAG, "Excess data at end of parcel");
        }
        source.setDataPosition(endPos);
    }
}

From source file:com.google.mr4c.util.CustomFormat.java

public List<String> getNameList() {
    return Collections.unmodifiableList(m_nameList);
}

From source file:de.chludwig.websec.saml2sp.security.SAMLUserDetailsServiceImpl.java

private List<GrantedAuthority> getGrantedAuthorities(SAMLCredential credential) {
    String rolesClaim = credential.getAttributeAsString("http://wso2.org/claims/role");
    List<GrantedAuthority> authorities = new ArrayList<>();
    if (StringUtils.isNotBlank(rolesClaim)) {
        String[] splitRolesClaim = StringUtils.split(rolesClaim, ",");
        for (String roleClaim : splitRolesClaim) {
            RoleId roleId = RoleId.valueById(roleClaim);
            if (roleId != null) {
                authorities.add(new SimpleGrantedAuthority(roleId.getId()));
            }/*from   ww w.j av a  2  s .co m*/
        }
    }

    // fallback in case the IdP did not provide any role claims
    if (authorities.isEmpty()) {
        authorities.add(new SimpleGrantedAuthority(RoleId.USER_ROLE_ID.getId()));
    }

    return Collections.unmodifiableList(authorities);
}

From source file:com.trenako.utility.Cat.java

/**
 * Returns the localized list of category labels by power method.
 *
 * @param pm the power method/*from   w w w .  j a  va 2 s.  c o m*/
 * @param ms the message source
 * @return the list of {@code Cat}
 */
public static Iterable<Cat> list(PowerMethod pm, MessageSource ms) {
    List<Cat> list = new ArrayList<>(Category.values().length);
    for (Category c : Category.values()) {
        list.add(buildCat(pm, c, ms));
    }

    return Collections.unmodifiableList(list);
}

From source file:at.gv.egiz.slbinding.SLUnmarshaller.java

public static Collection<String> getDefaultSchemaUrls() {
    return Collections.unmodifiableList(Arrays.asList(DefaultSchema.SCHEMA_FILES));
}

From source file:com.eyeq.pivot4j.ui.impl.TableAxisContext.java

/**
 * @return the rootLevels
 */
public List<Level> getLevels(Hierarchy hierarchy) {
    return Collections.unmodifiableList(levelMap.get(hierarchy));
}

From source file:de.jcup.egradle.core.domain.GradleCommand.java

/**
 * Combines subproject with command//  ww  w . ja va2  s  . co m
 * 
 * @param subProject
 *            - the project where the command/task is executed
 * @param command
 *            - the task to execute
 */
private GradleCommand(GradleSubproject subProject, String command, List<String> commandArguments) {
    StringBuilder sb = new StringBuilder();
    if (subProject != null) {
        sb.append(':');
        sb.append(subProject.getName());
        sb.append(':');
    }
    sb.append(command);
    this.command = sb.toString();

    if (commandArguments == null) {
        this.commandArguments = Collections.emptyList();
    } else {
        this.commandArguments = Collections.unmodifiableList(commandArguments);
    }
}

From source file:edu.umich.oasis.common.SodaDetails.java

public void readFromParcel(Parcel source) {
    final int length = source.readInt();
    final int endPos = source.dataPosition() + length;

    if (localLOGV) {
        Log.v(TAG, "Unparceling, length " + length);
    }// w w  w.j  ava  2 s  . c o m

    if (source.dataPosition() < endPos) {
        descriptor = SodaDescriptor.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Descriptor: " + descriptor);
        }
    }
    if (source.dataPosition() < endPos) {
        resultType = source.readString();
        if (localLOGV) {
            Log.v(TAG, "Result type: " + resultType);
        }
    }
    if (source.dataPosition() < endPos) {
        paramInfo = source.createTypedArrayList(ParamInfo.CREATOR);
        if (paramInfo != null) {
            if (localLOGV) {
                Log.v(TAG, "Param info (size " + paramInfo.size() + "):");
                for (ParamInfo pi : paramInfo) {
                    Log.v(TAG, "    " + pi);
                }
            }
            paramInfo = Collections.unmodifiableList(paramInfo);
        } else if (localLOGV) {
            Log.v(TAG, "Param info (null)");
        }
    }
    if (source.dataPosition() < endPos) {
        requiredTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Required taints: " + requiredTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        optionalTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Optional taints: " + optionalTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        if (localLOGD) {
            Log.d(TAG, "Excess data at end of parcel");
        }
        source.setDataPosition(endPos);
    }
}