01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/osp/tags/sakai_2-4-1/integration/api/src/java/org/theospi/portfolio/admin/model/IntegrationList.java $
03: * $Id: IntegrationList.java 11372 2006-06-29 14:58:30Z chmaurer@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.theospi.portfolio.admin.model;
21:
22: import org.apache.commons.logging.Log;
23: import org.apache.commons.logging.LogFactory;
24: import org.theospi.portfolio.shared.model.OspException;
25:
26: import java.util.ArrayList;
27: import java.util.Iterator;
28: import java.util.List;
29:
30: public class IntegrationList {
31: protected final transient Log logger = LogFactory
32: .getLog(getClass());
33:
34: private String title;
35: private String description;
36: private List options;
37:
38: public IntegrationList() {
39: }
40:
41: public IntegrationList(List options, String title) {
42: this .options = options;
43: this .title = title;
44: }
45:
46: public IntegrationList(IntegrationList copy) {
47: this .options = createCopy(copy.options);
48: this .title = copy.title;
49: this .description = copy.description;
50: }
51:
52: protected List createCopy(List options) {
53: List newList = new ArrayList();
54:
55: for (Iterator i = options.iterator(); i.hasNext();) {
56: try {
57: newList.add(((IntegrationOption) i.next()).clone());
58: } catch (CloneNotSupportedException e) {
59: logger.error("", e);
60: throw new OspException(e);
61: }
62: }
63: return newList;
64: }
65:
66: public List getOptions() {
67: return options;
68: }
69:
70: public void setOptions(List options) {
71: this .options = options;
72: }
73:
74: public String getTitle() {
75: return title;
76: }
77:
78: public void setTitle(String title) {
79: this .title = title;
80: }
81:
82: public String getDescription() {
83: return description;
84: }
85:
86: public void setDescription(String description) {
87: this.description = description;
88: }
89: }
|