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:com.epam.ta.reportportal.ws.resolver.JsonViewSupportFactoryBean.java

private List<HandlerMethodReturnValueHandler> decorateHandlers(List<HandlerMethodReturnValueHandler> handlers) {

    /*/*from   w  ww  .  j  av  a  2s.com*/
     * We have to create new collection here, because initial list is
     * unmodifiable
     */
    List<HandlerMethodReturnValueHandler> updatedHandlers = new ArrayList<>(handlers.size());
    for (HandlerMethodReturnValueHandler handler : handlers) {
        if (handler instanceof RequestResponseBodyMethodProcessor) {
            updatedHandlers.add(new JacksonViewReturnValueHandler(handler));
        } else {
            updatedHandlers.add(handler);
        }
    }
    return Collections.unmodifiableList(updatedHandlers);
}

From source file:org.cleverbus.core.alerts.AbstractAlertsConfiguration.java

@Override
public final List<AlertInfo> getAlerts(boolean enabledOnly) {
    if (!enabledOnly) {
        // return all
        return Collections.unmodifiableList(alerts);

    } else {// www  . j  a  v  a  2s  . c o m
        // note: wouldn't be better to keep duplicated list of enabled alerts?
        List<AlertInfo> retAlerts = new ArrayList<AlertInfo>();
        for (AlertInfo alert : alerts) {
            if (alert.isEnabled()) {
                retAlerts.add(alert);
            }
        }

        return retAlerts;
    }
}

From source file:com.zb.app.web.tools.EnumViewTools.java

public static List<RightMenuEnum> getManageRightMenu() {
    List<RightMenuEnum> rightMenuEnumList = Arrays
            .asList(new RightMenuEnum[] { RightMenuEnum.COMPANY_MANAGE, RightMenuEnum.LINE_MANAGE,
                    RightMenuEnum.ORDER_MANAGE, RightMenuEnum.NEWS_MANAGE, RightMenuEnum.GIFT_MANAGE,
                    RightMenuEnum.SYSTEM_MANAGE, RightMenuEnum.INTEGRAL_MANAGE, RightMenuEnum.COUNT_MANAGE });
    return Collections.unmodifiableList(rightMenuEnumList);
}

From source file:com.axibase.tsd.driver.jdbc.content.ContentMetadata.java

public ContentMetadata(String scheme, String sql, String connectionId, int statementId)
        throws AtsdException, IOException {
    metadataList = StringUtils.isNoneEmpty(scheme) ? buildMetadataList(scheme)
            : Collections.<ColumnMetaData>emptyList();
    sign = new Signature(metadataList, sql, Collections.<AvaticaParameter>emptyList(), null, CursorFactory.LIST,
            StatementType.SELECT);/*from  w  w  w  .j a v a2s.co m*/
    list = Collections.unmodifiableList(
            Collections.singletonList(MetaResultSet.create(connectionId, statementId, false, sign, null)));
}

From source file:com.alfaariss.oa.engine.idp.storage.configuration.AbstractConfigurationStorage.java

/**
 * @see com.alfaariss.oa.engine.core.idp.storage.IIDPStorage#getAll()
 *//*from w w  w .  j  a v  a 2 s  .c  o  m*/
@Override
public List<IIDP> getAll() {
    return Collections.unmodifiableList(_listIDPs);
}

From source file:net.big_oh.common.jdbc.JdbcObserverProxyConnectionInvocationHandler.java

JdbcObserverProxyConnectionInvocationHandler(Connection originalConnection, List<JDBCEventListener> listeners) {
    this.originalConnection = originalConnection;

    // Create a new list of listeners to side-step the possibility of
    // ConcurrentModificationException
    this.listeners = Collections.unmodifiableList(new ArrayList<JDBCEventListener>(listeners));
}

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

@Override
public List<Role> getRoles() {
    return Collections.unmodifiableList(new ArrayList<>(roles));
}

From source file:com.jklas.sample.petclinic.Pet.java

public List getVisits() {
    List sortedVisits = new ArrayList(getVisitsInternal());
    PropertyComparator.sort(sortedVisits, new MutableSortDefinition("date", false, false));
    return Collections.unmodifiableList(sortedVisits);
}

From source file:com.quartercode.disconnected.sim.run.Ticker.java

/**
 * Returns a list of tick actions which get called on every tick.
 * /*from  www. ja va 2s .com*/
 * @return A list of tick actions which get called on every tick.
 */
public List<TickAction> getActions() {

    return Collections.unmodifiableList(actions);
}

From source file:de.fuberlin.wiwiss.r2r.TargetPattern.java

public List<Triple> getPath() {
    return Collections.unmodifiableList(path);
}