01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.base;
19:
20: import java.io.Serializable;
21: import java.util.ArrayList;
22: import java.util.List;
23:
24: final public class ParameterDescription implements Serializable {
25: public static final boolean REQUIRED = true;
26:
27: public static final boolean OPTIONAL = false;
28:
29: public static final boolean CONSTRAINED = true;
30:
31: public static final boolean UNCONSTRAINED = false;
32:
33: final private boolean required;
34:
35: private String name;
36:
37: private String description;
38:
39: private boolean constrained;
40:
41: private List<String> allowedValues;
42:
43: public ParameterDescription(String name) {
44: this (name, "");
45: }
46:
47: public ParameterDescription(String name, String description) {
48: this (name, description, false);
49: }
50:
51: public ParameterDescription(String name, String description,
52: boolean required) {
53: this .name = name;
54: this .description = description;
55: this .required = required;
56: allowedValues = new ArrayList<String>();
57: }
58:
59: public void setDescription(String description) {
60: this .description = description;
61: }
62:
63: public void setName(String name) {
64: this .name = name;
65: }
66:
67: public String getName() {
68: return name;
69: }
70:
71: public String getDescription() {
72: return description;
73: }
74:
75: public boolean isRequired() {
76: return required;
77: }
78:
79: public void setConstrained(boolean constrained) {
80: this .constrained = constrained;
81: }
82:
83: public boolean isConstrained() {
84: return constrained;
85: }
86:
87: public List getAllowedValues() {
88: return allowedValues;
89: }
90:
91: public void addAllowedValue(String allowedValue) {
92: allowedValues.add(allowedValue);
93: }
94:
95: }
|