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:jodtemplate.template.expression.VariableExpression.java

public List<String> getParams() {
    return Collections.unmodifiableList(new ArrayList<>(params));
}

From source file:cz.fi.muni.pa036.airticketbooking.dao.impl.FlightTicketDaoImpl.java

@Override
public List<FlightTicket> getAll() {
    Query q = em.createQuery("FROM FlightTicket");
    List<FlightTicket> objectTemp = q.getResultList();

    return Collections.unmodifiableList(objectTemp);
}

From source file:com.thoughtworks.go.plugin.infra.plugininfo.DefaultPluginRegistry.java

@Override
public List<GoPluginDescriptor> plugins() {
    return Collections.unmodifiableList(new ArrayList<>(idToDescriptorMap.values()));
}

From source file:com.sonatype.nexus.perftest.maven.CsvLogParser.java

@JsonCreator
public CsvLogParser(@JsonProperty("logfile") File logfile) throws IOException {

    ArrayList<String> paths = new ArrayList<>();
    try (BufferedReader br = new BufferedReader(
            new InputStreamReader(new GZIPInputStream(new FileInputStream(logfile))))) {
        String str;/* ww  w . j  av  a  2  s.co m*/
        while ((str = br.readLine()) != null) {
            StringTokenizer st = new StringTokenizer(str, ",");
            paths.add(st.nextToken()); // full path
        }
    }
    this.paths = Collections.unmodifiableList(paths);
}

From source file:com.github.jknack.css.Rule.java

public List<Selector> selectors() {
    return Collections.unmodifiableList(selectors);
}

From source file:com.webbfontaine.valuewebb.irms.impl.risk.repository.RiskRule.java

@Override
public List<RiskResult> applyRule() {
    Validate.notNull(getSource());/*from w  w w. ja v a  2 s  . co  m*/
    Validate.notNull(getParameters());

    execute();

    return Collections.unmodifiableList(riskResult$$);
}

From source file:ca.travelagency.persistence.query.Where.java

List<Object> getParameters() {
    return Collections.unmodifiableList(parameters);
}

From source file:cf.client.Token.java

public static Token parseJson(InputStream json) {
    try {//from   ww w.  j  av  a  2 s.  c om
        final JsonNode node = new ObjectMapper().readTree(json);
        final String accessToken = node.get("access_token").asText();
        final Type type = Type.getType(node.get("token_type").asText());
        final Date expiration = new Date(System.currentTimeMillis() + node.get("expires_in").asLong());
        final String rawScopes = node.get("scope").asText();
        final String[] splitScopes = rawScopes.split("\\s+");
        final List<String> scopes = Collections.unmodifiableList(Arrays.asList(splitScopes));
        final UUID jti = UUID.fromString(node.get("jti").asText());
        return new Token(accessToken, type, expiration, scopes, jti);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

From source file:com.cronutils.model.time.TimeNode.java

public List<Integer> getValues() {
    return Collections.unmodifiableList(values);
}

From source file:com.github.carlomicieli.nerdmovies.security.MailUserDetails.java

public Collection<? extends GrantedAuthority> getAuthorities() {
    List<String> l = mailUser.getRoles();
    String[] roles = l == null ? new String[] { "ROLE_USER" } : l.toArray(new String[l.size()]);

    return Collections.unmodifiableList(AuthorityUtils.createAuthorityList(roles));
}