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:it.anyplace.sync.discovery.utils.AddressRanker.java

private AddressRanker(Iterable<DeviceAddress> sourceAddresses) {
    this.sourceAddresses = Collections.unmodifiableList(Lists.newArrayList(sourceAddresses));
    this.targetAddresses = Collections.synchronizedList(Lists.<DeviceAddress>newArrayList());
}

From source file:interactivespaces.util.resource.ManagedResources.java

/**
 * Get a list of the currently managed resources.
 *
 * @return list of managed resources//  ww w  . j a  v a2s.co  m
 */
public synchronized List<ManagedResource> getResources() {
    return Collections.unmodifiableList(resources);
}

From source file:cz.fi.muni.pa165.facade.GameFacadeImpl.java

@Override
public List<GameDTO> findGamesBetweenTeams(long teamId1, long teamId2) {
    List<GameDTO> games = new ArrayList<>();
    gameService.findGamesBetweenTeams(teamId1, teamId2).stream().forEach((g) -> {
        games.add(beanMappingService.mapTo(calculateScore(g), GameDTO.class));
    });/*from w  w w  .j av  a  2  s.  c o m*/
    return Collections.unmodifiableList(games);
}

From source file:com.hp.octane.integrations.uft.items.UftTestDiscoveryResult.java

private List<AutomatedTest> getTestByOctaneStatus(OctaneStatus status) {
    List<AutomatedTest> filtered = new ArrayList<>();
    for (AutomatedTest test : tests) {
        if (test.getOctaneStatus().equals(status)) {
            filtered.add(test);// ww  w. j a  v a2  s  .c  om
        }
    }
    return Collections.unmodifiableList(filtered);
}

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

private SodaDescriptor(int kind, ComponentName definingClass, String methodName, List<String> paramTypes,
        boolean makeCopy) {
    if (kind != KIND_INSTANCE && kind != KIND_STATIC && kind != KIND_CTOR) {
        throw new IllegalArgumentException("Unknown kind " + kind);
    }/*from  w ww  . j av  a2 s . c  o m*/

    this.kind = kind;

    this.definingClass = Objects.requireNonNull(definingClass, "definingClass");
    this.methodName = (kind != KIND_CTOR) ? Objects.requireNonNull(methodName, "methodName") : null;
    this.paramTypes = (paramTypes != null)
            ? Collections.unmodifiableList(makeCopy ? new ArrayList<>(paramTypes) : paramTypes)
            : Collections.<String>emptyList();
}

From source file:org.codehaus.griffon.plugins.AbstractGriffonPluginManager.java

public List<TypeFilter> getTypeFilters() {
    List<TypeFilter> list = new ArrayList<TypeFilter>();
    for (GriffonPlugin griffonPlugin : pluginList) {
        list.addAll(griffonPlugin.getTypeFilters());
    }//w w  w  . j  a v  a  2 s.  co m
    return Collections.unmodifiableList(list);
}

From source file:com.bluexml.side.portal.alfresco.reverse.reverser.LayoutReverser.java

public List<Region> getRegions() {
    return Collections.unmodifiableList(regions);
}

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

private QMDescriptor(int kind, ComponentName definingClass, String methodName, List<String> paramTypes,
        boolean makeCopy) {
    if (kind != KIND_INSTANCE && kind != KIND_STATIC && kind != KIND_CTOR) {
        throw new IllegalArgumentException("Unknown kind " + kind);
    }/*from w w  w  . j  a  v a  2  s.  co m*/

    this.kind = kind;

    this.definingClass = Objects.requireNonNull(definingClass, "definingClass");
    this.methodName = (kind != KIND_CTOR) ? Objects.requireNonNull(methodName, "methodName") : null;
    this.paramTypes = (paramTypes != null)
            ? Collections.unmodifiableList(makeCopy ? new ArrayList<>(paramTypes) : paramTypes)
            : Collections.<String>emptyList();
}

From source file:com.haulmont.timesheets.global.WorkTimeConfigBean.java

public List<DayOfWeek> getWorkDays() {
    List<String> days = workTimeConfig.getWorkDays();
    if (days.isEmpty()) {
        return Collections.emptyList();
    }/*from w w  w. j a va  2s.c o  m*/
    List<DayOfWeek> workDays = new ArrayList<>(days.size());
    for (String day : days) {
        workDays.add(DayOfWeek.fromAbbreviation(day));
    }
    return Collections.unmodifiableList(workDays);
}

From source file:net.dv8tion.jda.core.entities.impl.MessageEmbedImpl.java

@Override
public List<Field> getFields() {
    return Collections.unmodifiableList(fields);
}