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:org.capatect.restatic.core.discoverer.file.AntStylePatternFileNameFilter.java

/**
 * @return An unmodifiable list of the patterns of this filter.
 */
public List<String> getPatterns() {
    return Collections.unmodifiableList(patterns);
}

From source file:org.hobsoft.contacts.client.event.ContactCollector.java

public List<Contact> getCreatedContacts() {
    return Collections.unmodifiableList(createdContacts);
}

From source file:hr.fer.zemris.vhdllab.service.result.Result.java

public Result(String data, List<String> messages) {
    Validate.notNull(messages, "Messages can't be null");
    if (messages.isEmpty()) {
        Validate.notNull(data, "Data can't be null if there are no messages");
    }/* w  ww.  j a  v  a 2  s .c  om*/
    this.data = data;
    this.messages = Collections.unmodifiableList(new ArrayList<String>(messages));
}

From source file:com.doculibre.constellio.feedprotocol.model.impl.FeedGroupImpl.java

public FeedGroupImpl(String action, List<FeedRecord> records) throws ParseFeedException {
    if (action == null) {
        this.action = ACTION.ADD;
    } else if (action.equals(ADD)) {
        this.action = ACTION.ADD;
    } else if (action.equals(DELETE)) {
        this.action = ACTION.DELETE;
    } else {//from  w w  w  . ja  va 2 s .c  o m
        throw new ParseFeedException("Invalid action: " + action);
    }

    if (CollectionUtils.isEmpty((Collection) records)) {
        throw new ParseFeedException("Records is empty");
    }
    List<FeedRecord> recordsTemp = new ArrayList<FeedRecord>();
    recordsTemp.addAll(records);
    this.records = Collections.unmodifiableList(recordsTemp);
}

From source file:org.cleverbus.core.common.contextcall.ContextCallParams.java

/**
 * Gets method arguments (if any)./*from   w w w . j a v a  2 s. c  om*/
 *
 * @return method arguments, can be empty
 */
public List<Object> getMethodArgs() {
    return Collections.unmodifiableList(methodArgs);
}

From source file:edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions.java

private Actions(List<Set<RequestedAction>> oldList, Collection<RequestedAction> newActions) {
    List<Set<RequestedAction>> newList = new ArrayList<Set<RequestedAction>>();
    newList.addAll(oldList);/* ww  w.  jav a2  s .co m*/

    Set<RequestedAction> newActionSet = new HashSet<RequestedAction>(newActions);
    if (!newActionSet.isEmpty()) {
        newList.add(Collections.unmodifiableSet(newActionSet));
    }
    this.clauseList = Collections.unmodifiableList(newList);
}

From source file:com.lonepulse.zombielink.request.RequestUtils.java

/**
 * <p>Finds all <b><i>constant</i> request parameters</b> in the given {@link InvocationContext}.</p> 
 * <p>Constant request parameters are introduced with @{@link Param} at <b>request level</b> using 
 * the @{@link QueryParams} annotation.</p>
 *
 * @param context/*from  w  w  w  .j  a  v  a  2 s . c om*/
 *          the {@link InvocationContext} from which all {@link QueryParams} annotations applied 
 *          on the endpoint method will be extracted
 * <br><br>
 * @return an <b>unmodifiable</b> {@link List} which aggregates all the @{@link Param} annotations 
 *             found on the {@link QueryParams} annotation
 * <br><br>
 * @throws NullPointerException
 *          if the supplied {@link InvocationContext} was {@code null}
 * <br><br>
 * @since 1.3.0
 */
static List<Param> findStaticQueryParams(InvocationContext context) {

    Method request = assertNotNull(context).getRequest();

    QueryParams queryParams = request.getAnnotation(QueryParams.class);

    return Collections.unmodifiableList(
            queryParams != null ? Arrays.asList(queryParams.value()) : new ArrayList<Param>());
}

From source file:jodtemplate.contenttype.ContentTypes.java

public List<OverrideElement> getOverridesByType(final String type) {
    final List<OverrideElement> selectedList = (List<OverrideElement>) CollectionUtils.select(overrideElements,
            new Predicate<OverrideElement>() {
                @Override/*from w  ww.  j  av  a 2s.c  o m*/
                public boolean evaluate(final OverrideElement source) {
                    return type.equals(source.getContentType());
                }
            });
    return Collections.unmodifiableList(selectedList);
}

From source file:org.jtalks.poulpe.util.databasebackup.persistence.DbTableLister.java

/**
 * Returns the list of all database table names which database contains from given Data source via JDBC.
 * /*  w  w w  .j  a  v a2 s  . c o m*/
 * @return a List of Strings where every String instance represents a table name from the database.
 * @throws SQLException
 *             is thrown if there is an error during collaborating with the database.
 */
@SuppressWarnings("unchecked")
private List<String> getTableNames() throws MetaDataAccessException {
    Validate.notNull(dataSource, "dataSource must not be null");
    return Collections.unmodifiableList(
            (List<String>) JdbcUtils.extractDatabaseMetaData(dataSource, new DatabaseMetaDataCallback() {
                @Override
                public Object processMetaData(DatabaseMetaData dmd)
                        throws SQLException, MetaDataAccessException {
                    List<String> tableList = new ArrayList<String>();
                    ResultSet rs = dmd.getTables(null, null, null, new String[] { "TABLE" });
                    while (rs.next()) {
                        tableList.add(rs.getString("TABLE_NAME"));
                    }

                    return tableList;
                }
            }));
}

From source file:ca.uhn.fhir.context.RuntimeChildChoiceDefinition.java

void setChoiceTypes(List<Class<? extends IBase>> theChoiceTypes) {
    myChoiceTypes = Collections.unmodifiableList(theChoiceTypes);
}