01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12:
13: package com.eviware.soapui.model.support;
14:
15: import java.util.List;
16:
17: import com.eviware.soapui.model.ModelItem;
18:
19: /**
20: * Utility methods for soapui model-related interfaces
21: *
22: * @author Ole.Matzura
23: */
24:
25: public class ModelSupport {
26: public static String[] getNames(List<? extends ModelItem> list) {
27: String[] names = new String[list.size()];
28: for (int c = 0; c < names.length; c++) {
29: names[c] = list.get(c).getName();
30: }
31:
32: return names;
33: }
34:
35: public static String[] getNames(String[] firstItems,
36: List<? extends ModelItem> list) {
37: String[] names = new String[list.size() + firstItems.length];
38: for (int c = 0; c < firstItems.length; c++) {
39: names[c] = firstItems[c];
40: }
41:
42: for (int c = 0; c < list.size(); c++) {
43: names[c + firstItems.length] = list.get(c).getName();
44: }
45:
46: return names;
47: }
48:
49: public static String[] getNames(List<? extends ModelItem> list,
50: String[] lastItems) {
51: String[] names = new String[list.size() + lastItems.length];
52: for (int c = 0; c < lastItems.length; c++) {
53: names[c + list.size()] = lastItems[c];
54: }
55:
56: for (int c = 0; c < list.size(); c++) {
57: names[c] = list.get(c).getName();
58: }
59:
60: return names;
61: }
62:
63: }
|