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.e2.bw.servicereg.ldap.model.CachedOrganization.java

/** Constructor */
public CachedOrganization(String organizationId, String name, String summary, String url, String country,
        byte[] logo, List<String> memberIds, Map<String, List<String>> roleUserMap) {
    super.setOrganizationId(organizationId);
    super.setName(name);
    super.setSummary(summary);
    super.setUrl(url);
    super.setCountry(country);
    super.setLogo(logo);
    this.memberIds = Collections.unmodifiableList(memberIds != null ? memberIds : new ArrayList<>());
    this.roleUserMap = Collections.unmodifiableMap(roleUserMap != null ? roleUserMap : new HashMap<>());
    // NB: Actually, each element of the roleUserMap should be made unmodifiable...
}

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

@Override
public List<Airline> getAll() {
    try {/*from ww  w  .j av a 2s  . c om*/
        Query q = em.createQuery("FROM Airline");
        List<Airline> objectTemp = q.getResultList();

        return Collections.unmodifiableList(objectTemp);
    } catch (PersistenceException | IllegalArgumentException ex) {
        throw new DataAccessException(ex.getMessage(), ex) {
        };
    }
}

From source file:net.javacrumbs.springws.test.AbstractMockWebServiceMessageSender.java

public List<EndpointInterceptor> getInterceptors() {
    return Collections.unmodifiableList(interceptors);
}

From source file:com.google.uzaygezen.core.MultiDimensionalSpec.java

public MultiDimensionalSpec(List<Integer> bitsPerDimension) {
    int maxBits = 0;
    int sumBits = 0;
    for (int bitsPerDim : bitsPerDimension) {
        Preconditions.checkArgument(bitsPerDim >= 0,
                "The number of bits for each dimension must be non-negative.");
        if (maxBits < bitsPerDim) {
            maxBits = bitsPerDim;//from   w w  w .  j av a 2  s . c  o  m
        }
        sumBits += bitsPerDim;
        Preconditions.checkArgument(sumBits >= 0, "The sum of the all bits must fit in int");
    }
    this.bitsPerDimension = Collections.unmodifiableList(Lists.newArrayList(bitsPerDimension));
    this.maxBitsPerDimension = maxBits;
    this.sumBitsPerDimension = sumBits;
}

From source file:org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails.java

public PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails(PortletRequest request,
        Collection<? extends GrantedAuthority> authorities) {
    super(request);

    List<GrantedAuthority> temp = new ArrayList<GrantedAuthority>(authorities);
    this.authorities = Collections.unmodifiableList(temp);
}

From source file:com.trenako.services.WishListsServiceImpl.java

@Override
public Iterable<WishList> findByOwner(Account owner) {
    List<WishList> results = list(repo.findByOwner(owner));

    if (addDefaultWishList(results, owner) == true) {
        results.add(WishList.defaultList(owner));
    }//  ww w  .ja v a 2s  .  c  o m

    return Collections.unmodifiableList(results);
}

From source file:com.evolveum.midpoint.repo.sql.query.definition.EntityDefinition.java

public List<Definition> getDefinitions() {
    if (definitions == null) {
        definitions = new ArrayList<Definition>();
    }/*from   w w w . ja va2s. c  om*/

    return Collections.unmodifiableList(definitions);
}

From source file:edu.cornell.mannlib.vitro.webapp.utils.searchengine.AutoCompleteWords.java

private List<String> figureTermWords() {
    List<String> list = new ArrayList<String>();
    String[] array = this.searchTerm.split(this.delimiterPattern);
    for (String word : array) {
        String trimmed = word.trim();
        if (!trimmed.isEmpty()) {
            list.add(trimmed);/* w  ww .j  a v a  2  s .  co m*/
        }
    }
    return Collections.unmodifiableList(list);
}

From source file:com.ebay.jetstream.event.processor.esper.EPL.java

/**
 * Gets the list of EPL statements. //  ww w  .  j  a  va  2  s  .co  m
 *
 * @return the list of all statements.
 */
@Hidden
public List<String> getStatements() {
    return Collections.unmodifiableList(m_statements);
}

From source file:cf.nats.message.RouterRegister.java

@JsonCreator
public RouterRegister(@JsonProperty("host") String host, @JsonProperty("port") Integer port,
        @JsonProperty("app") String app, @JsonProperty("dea") String dea,
        @JsonProperty("uris") List<String> uris, @JsonProperty("tags") Map<String, String> tags) {
    this.host = host;
    this.port = port;
    this.app = app;
    this.dea = dea;
    this.uris = Collections.unmodifiableList(new ArrayList<>(uris));
    this.tags = tags == null ? null : Collections.unmodifiableMap(new HashMap<>(tags));
}