KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > interfaces > FileData


1 /*
2  * Generated by XDoclet - Do not edit!
3  */

4 package test.interfaces;
5
6 /**
7  * Data object for File.
8  * @xdoclet-generated at 16-04-05
9  * @copyright The XDoclet Team
10  * @author XDoclet
11  * @version 1.2.3
12  */

13 public class FileData
14    extends java.lang.Object JavaDoc
15    implements java.io.Serializable JavaDoc
16 {
17    private java.lang.String JavaDoc id;
18    private byte[] content;
19    private java.lang.String JavaDoc contentType;
20    private java.util.Date JavaDoc creationDate;
21
22   /* begin value object */
23
24   /* end value object */
25
26    public FileData()
27    {
28    }
29
30    public FileData( java.lang.String JavaDoc id,byte[] content,java.lang.String JavaDoc contentType,java.util.Date JavaDoc creationDate )
31    {
32       setId(id);
33       setContent(content);
34       setContentType(contentType);
35       setCreationDate(creationDate);
36    }
37
38    public FileData( FileData otherData )
39    {
40       setId(otherData.getId());
41       setContent(otherData.getContent());
42       setContentType(otherData.getContentType());
43       setCreationDate(otherData.getCreationDate());
44
45    }
46
47    public java.lang.String JavaDoc getPrimaryKey() {
48      return getId();
49    }
50
51    public java.lang.String JavaDoc getId()
52    {
53       return this.id;
54    }
55    public void setId( java.lang.String JavaDoc id )
56    {
57       this.id = id;
58    }
59
60    public byte[] getContent()
61    {
62       return this.content;
63    }
64    public void setContent( byte[] content )
65    {
66       this.content = content;
67    }
68
69    public java.lang.String JavaDoc getContentType()
70    {
71       return this.contentType;
72    }
73    public void setContentType( java.lang.String JavaDoc contentType )
74    {
75       this.contentType = contentType;
76    }
77
78    public java.util.Date JavaDoc getCreationDate()
79    {
80       return this.creationDate;
81    }
82    public void setCreationDate( java.util.Date JavaDoc creationDate )
83    {
84       this.creationDate = creationDate;
85    }
86
87    public String JavaDoc toString()
88    {
89       StringBuffer JavaDoc str = new StringBuffer JavaDoc("{");
90
91       str.append("id=" + getId() + " " + "content=" + getContent() + " " + "contentType=" + getContentType() + " " + "creationDate=" + getCreationDate());
92       str.append('}');
93
94       return(str.toString());
95    }
96
97    public boolean equals( Object JavaDoc pOther )
98    {
99       if( pOther instanceof FileData )
100       {
101          FileData lTest = (FileData) pOther;
102          boolean lEquals = true;
103
104          if( this.id == null )
105          {
106             lEquals = lEquals && ( lTest.id == null );
107          }
108          else
109          {
110             lEquals = lEquals && this.id.equals( lTest.id );
111          }
112          lEquals = lEquals && this.content == lTest.content;
113          if( this.contentType == null )
114          {
115             lEquals = lEquals && ( lTest.contentType == null );
116          }
117          else
118          {
119             lEquals = lEquals && this.contentType.equals( lTest.contentType );
120          }
121          if( this.creationDate == null )
122          {
123             lEquals = lEquals && ( lTest.creationDate == null );
124          }
125          else
126          {
127             lEquals = lEquals && this.creationDate.equals( lTest.creationDate );
128          }
129
130          return lEquals;
131       }
132       else
133       {
134          return false;
135       }
136    }
137
138    public int hashCode()
139    {
140       int result = 17;
141
142       result = 37*result + ((this.id != null) ? this.id.hashCode() : 0);
143
144       if (content != null) {
145         for (int i=0; i<content.length; i++)
146         {
147           long l = content[i];
148           result = 37*result + (int)(l^(l>>>32));
149         }
150       }
151
152       result = 37*result + ((this.contentType != null) ? this.contentType.hashCode() : 0);
153
154       result = 37*result + ((this.creationDate != null) ? this.creationDate.hashCode() : 0);
155
156       return result;
157    }
158
159 }
160
Popular Tags