001: /*
002: * SalomeTMF is a Test Management Framework
003: * Copyright (C) 2005 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * @author Marche Mikael
020: *
021: * Contact: mikael.marche@rd.francetelecom.com
022: */
023:
024: package salomeTMF_plug.requirements.sqlWrapper;
025:
026: import java.util.Hashtable;
027:
028: import org.objectweb.salome_tmf.api.data.DataWrapper;
029: import org.objectweb.salome_tmf.ihm.languages.Language;
030:
031: public class ReqWrapper extends DataWrapper {
032: int parent_id;
033: int type;
034: int project_id;
035:
036: //From 1.2
037: String version = "1";
038: int priority = 100;
039:
040: //FROM 1.3
041: int cat = 0;
042: int complexe = 100;
043: String origine = "Marketing";
044: int state = 0;
045: String verif = "";
046: String reference = "";
047:
048: static Hashtable catMap;
049: static Hashtable stateMap;
050: static Hashtable complexMap;
051: static {
052: catMap = new Hashtable();
053: catMap.put(new Integer(0), Language.getInstance().getText(
054: "Cat_Fonctionnel"));
055: catMap.put(new Integer(1), Language.getInstance().getText(
056: "Cat_Interoperabilite"));
057: catMap.put(new Integer(2), Language.getInstance().getText(
058: "Cat_Charge"));
059: catMap.put(new Integer(3), Language.getInstance().getText(
060: "Cat_Performance"));
061: catMap.put(new Integer(4), Language.getInstance().getText(
062: "Cat_Disponibilite"));
063: catMap.put(new Integer(5), Language.getInstance().getText(
064: "Cat_Securite"));
065: catMap.put(new Integer(6), Language.getInstance().getText(
066: "Cat_Exploitabilite"));
067: catMap.put(new Integer(7), Language.getInstance().getText(
068: "Cat_Autre"));
069:
070: stateMap = new Hashtable();
071: stateMap.put(new Integer(0), Language.getInstance().getText(
072: "State_A_Analyser"));
073: stateMap.put(new Integer(1), Language.getInstance().getText(
074: "State_Analysee"));
075: stateMap.put(new Integer(2), Language.getInstance().getText(
076: "State_Approuvee"));
077: stateMap.put(new Integer(3), Language.getInstance().getText(
078: "State_Verifiee"));
079: stateMap.put(new Integer(4), Language.getInstance().getText(
080: "State_Finalisee"));
081: stateMap.put(new Integer(5), Language.getInstance().getText(
082: "State_Reportee"));
083: stateMap.put(new Integer(6), Language.getInstance().getText(
084: "State_Abandonnee"));
085:
086: complexMap = new Hashtable();
087: complexMap.put(new Integer(1000), Language.getInstance()
088: .getText("Com_C0"));
089: complexMap.put(new Integer(100), Language.getInstance()
090: .getText("Com_C1"));
091: complexMap.put(new Integer(10), Language.getInstance().getText(
092: "Com_C2"));
093: complexMap.put(new Integer(1), Language.getInstance().getText(
094: "Com_C3"));
095: }
096:
097: static public String getComplexString(int i) {
098: return (String) complexMap.get(new Integer(i));
099: }
100:
101: static public String getCatString(int i) {
102: return (String) catMap.get(new Integer(i));
103: }
104:
105: static public String getStateString(int i) {
106: return (String) stateMap.get(new Integer(i));
107: }
108:
109: public int getParent_id() {
110: return parent_id;
111: }
112:
113: public void setParent_id(int parent_id) {
114: this .parent_id = parent_id;
115: }
116:
117: public int getProject_id() {
118: return project_id;
119: }
120:
121: public void setProject_id(int project_id) {
122: this .project_id = project_id;
123: }
124:
125: public int getType() {
126: return type;
127: }
128:
129: public void setType(int type) {
130: this .type = type;
131: }
132:
133: //FROM 1.2
134: public int getPriority() {
135: return priority;
136: }
137:
138: public void setPriority(int priority) {
139: this .priority = priority;
140: }
141:
142: public String getVersion() {
143: return version;
144: }
145:
146: public void setVersion(String version) {
147: this .version = version;
148: }
149:
150: public String getReference() {
151: return reference;
152: }
153:
154: public void setReference(String reference) {
155: this .reference = reference;
156: }
157:
158: //From 1.3
159: public int getCat() {
160: return cat;
161: }
162:
163: public void setCat(int cat) {
164: this .cat = cat;
165: }
166:
167: public int getComplexe() {
168: return complexe;
169: }
170:
171: public void setComplexe(int complexe) {
172: this .complexe = complexe;
173: }
174:
175: public String getOrigine() {
176: return origine;
177: }
178:
179: public void setOrigine(String origine) {
180: this .origine = origine;
181: }
182:
183: public int getState() {
184: return state;
185: }
186:
187: public void setState(int state) {
188: this .state = state;
189: }
190:
191: public String getVerif() {
192: return verif;
193: }
194:
195: public void setVerif(String verif) {
196: this .verif = verif;
197: }
198:
199: public boolean equals(Object o) {
200: if (o instanceof ReqWrapper) {
201: ReqWrapper other = (ReqWrapper) o;
202: return (getIdBDD() == other.getIdBDD());
203: } else {
204: return false;
205: }
206: }
207:
208: public int hashCode() {
209: if (getIdBDD() > 0) {
210: return getIdBDD();
211: }
212: return super.hashCode();
213: }
214:
215: }
|