1    package com.instantbank.component.job.model;
2    
3    import java.io.Serializable;
4    import org.w3c.dom.Element;
5    import org.w3c.dom.Document;
6    //import com.instantbank.component.job.util.*;
7    
8    /**
9     * Value Object that represents a SELECT element of a Job
10    * (innmutable)
11    */
12   public class JobSELECTelement
13       implements Serializable {
14   
15     /**
16      * sequence
17      */
18     private int sequence;
19     /**
20      * field Identifier
21      */
22     private long fieldId;
23   
24   
25     /**
26      * Default Constructor
27      *
28      * @param sequence Description of the Parameter
29      * @param fieldId Description of the Parameter
30      */
31     public JobSELECTelement(int sequence, long fieldId) {
32       this.sequence = sequence;
33       this.fieldId = fieldId;
34     }
35   
36   
37     /**
38      *  Getter method for sequence
39      *
40      * @return sequence value
41      */
42     public int getSequence() {
43       return sequence;
44     }
45   
46   
47     /**
48      *  Getter method for fieldId
49      *
50      * @return fieldId value
51      */
52     public long getFieldId() {
53       return fieldId;
54     }
55   
56   
57     /**
58      *  Textual representation of JobSELECTelement
59      *
60      * @return associated text
61      */
62     public String toString() {
63       return "[sequence=" + sequence
64         + ", fieldId=" + fieldId + "]";
65     }
66   
67   
68     /**
69      *  XML representation of JobSELECTelement
70      *
71      * @param doc Description of the Parameter
72      * @return associated XML text
73      */
74     public Element toXml(Document doc) {
75       Element root = doc.createElement("JobSELECTelement");
76       root.setAttribute("Id", String.valueOf(sequence));
77   
78       Element node = doc.createElement("FieldId");
79       node.appendChild(doc.createTextNode(String.valueOf(fieldId)));
80       root.appendChild(node);
81       return root;
82     }
83   }
84