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:eu.stratosphere.api.common.operators.util.FieldList.java

@Override
public FieldList addField(Integer fieldID) {
    if (fieldID == null) {
        throw new IllegalArgumentException("Field ID must not be null.");
    }/*  www. j  a  va2 s  .c  o m*/

    if (size() == 0) {
        return new FieldList(fieldID);
    } else {
        ArrayList<Integer> list = new ArrayList<Integer>(size() + 1);
        list.addAll(this.collection);
        list.add(fieldID);
        return new FieldList(Collections.unmodifiableList(list));
    }
}

From source file:org.cloudfoundry.identity.uaa.scim.DefaultPasswordValidator.java

public DefaultPasswordValidator() {
    List<Rule> rules = new ArrayList<Rule>(6);
    rules.add(new LengthRule(10, 50));
    rules.add(new DigitCharacterRule());
    rules.add(new AlphabeticalCharacterRule());
    rules.add(new UsernameRule(true, true));
    // Try and catch variations on "password" as a password
    rules.add(new RegexRule("[pP]+[aA@&]*[sSzZ$]+[wW]+[oO0]*[rR]*[dD]*"));
    rules.add(new QwertySequenceRule());

    defaultRules = Collections.unmodifiableList(rules);

    rules = new ArrayList<Rule>(3);

    rules.add(new NumericalSequenceRule());
    rules.add(new RepeatCharacterRegexRule());
    rules.add(new AlphabeticalSequenceRule());

    shortRules = Collections.unmodifiableList(rules);
}

From source file:com.redhat.rhn.frontend.nav.NavNode.java

/**
 * Returns an unmodifiableList containing children of the node
 * @return List the children of the node
 *//*from www .j a v  a2s  .c o  m*/
public List<NavNode> getNodes() {
    return Collections.unmodifiableList(children);
}

From source file:com.ciphertool.zodiacengine.entities.Cipher.java

public List<Ciphertext> getCiphertextCharacters() {
    return Collections.unmodifiableList(ciphertextCharacters);
}

From source file:de.taimos.dao.hibernate.EntityDAOMock.java

@Override
public List<E> findList(final int first, final int max) {
    List<E> values = new ArrayList<>(this.entities.values());
    this.sortById(values);

    if (first >= 0) {
        if (max >= 0) {
            return Collections.unmodifiableList(values.subList(first, Math.max(first + max, values.size())));
        }/*  www .  j a  va2 s .  c  o m*/
        return Collections.unmodifiableList(values.subList(first, values.size()));
    }
    if (max >= 0) {
        return Collections.unmodifiableList(values.subList(0, Math.max(first + max, values.size())));
    }
    return Collections.unmodifiableList(values);
}

From source file:io.getlime.security.powerauth.rest.api.spring.authentication.PowerAuthApiAuthenticationImpl.java

@Override
public Collection<GrantedAuthority> getAuthorities() {
    ArrayList<GrantedAuthority> authorities = new ArrayList<>(1);
    authorities.add(new SimpleGrantedAuthority("USER"));
    return Collections.unmodifiableList(authorities);
}

From source file:hudson.plugins.clearcase.ClearCaseChangeLogSet.java

public ClearCaseChangeLogSet(AbstractBuild<?, ?> build, List<ClearCaseChangeLogEntry> logs) {
    super(build);
    for (ClearCaseChangeLogEntry entry : logs) {
        entry.setParent(this);
    }//  w  ww  .j  a v a  2s.  co m
    this.history = Collections.unmodifiableList(logs);
}

From source file:com.eyeq.pivot4j.ui.aggregator.AbstractAggregator.java

/**
 * @param axis//  ww w.j  a  v a  2s. c  o m
 * @param members
 * @param level
 * @param measure
 */
public AbstractAggregator(Axis axis, List<Member> members, Level level, Measure measure) {
    if (axis == null) {
        throw new NullArgumentException("axis");
    }

    this.axis = axis;

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

    this.level = level;
    this.measure = measure;
}

From source file:com.frank.search.solr.core.query.GroupOptions.java

/**
 * List of {@link Field}s to perform grouping by.
 * /*  w w w .ja  v  a2 s .com*/
 * @return
 */
public List<Field> getGroupByFields() {
    return Collections.unmodifiableList(this.groupByFields);
}

From source file:hr.fer.zemris.vhdllab.platform.listener.AbstractEventPublisher.java

@Override
public List<T> getListeners() {
    return Collections.unmodifiableList(listeners);
}