001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     bstefanescu
011 */
012package org.nuxeo.ecm.automation.core.util;
013
014import java.util.ArrayList;
015import java.util.Collection;
016
017/**
018 * A string list can be used as an injectable parameter when a list of strings is required. String list are injectable
019 * from a string value (comma separated list) or String[].
020 *
021 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
022 */
023public class StringList extends ArrayList<String> {
024
025    private static final long serialVersionUID = 1L;
026
027    public StringList() {
028    }
029
030    public StringList(int size) {
031        super(size);
032    }
033
034    public StringList(String[] ar) {
035        super(ar.length);
036        for (String v : ar) {
037            add(v);
038        }
039    }
040
041    public StringList(Collection<String> list) {
042        super(list.size());
043        addAll(list);
044    }
045
046}