source: proiecte/HadoopJUnit/hadoop-0.20.1/src/contrib/thriftfs/gen-java/org/apache/hadoop/thriftfs/api/FileStatus.java @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 10.4 KB
Line 
1/**
2 * Autogenerated by Thrift
3 *
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 */
6package org.apache.hadoop.thriftfs.api;
7
8import java.util.List;
9import java.util.ArrayList;
10import java.util.Map;
11import java.util.HashMap;
12import java.util.Set;
13import java.util.HashSet;
14import com.facebook.thrift.*;
15
16import com.facebook.thrift.protocol.*;
17import com.facebook.thrift.transport.*;
18
19public class FileStatus implements TBase, java.io.Serializable {
20  public String path;
21  public long length;
22  public boolean isdir;
23  public short block_replication;
24  public long blocksize;
25  public long modification_time;
26  public String permission;
27  public String owner;
28  public String group;
29
30  public final Isset __isset = new Isset();
31  public static final class Isset implements java.io.Serializable {
32    public boolean path = false;
33    public boolean length = false;
34    public boolean isdir = false;
35    public boolean block_replication = false;
36    public boolean blocksize = false;
37    public boolean modification_time = false;
38    public boolean permission = false;
39    public boolean owner = false;
40    public boolean group = false;
41  }
42
43  public FileStatus() {
44  }
45
46  public FileStatus(
47    String path,
48    long length,
49    boolean isdir,
50    short block_replication,
51    long blocksize,
52    long modification_time,
53    String permission,
54    String owner,
55    String group)
56  {
57    this();
58    this.path = path;
59    this.__isset.path = true;
60    this.length = length;
61    this.__isset.length = true;
62    this.isdir = isdir;
63    this.__isset.isdir = true;
64    this.block_replication = block_replication;
65    this.__isset.block_replication = true;
66    this.blocksize = blocksize;
67    this.__isset.blocksize = true;
68    this.modification_time = modification_time;
69    this.__isset.modification_time = true;
70    this.permission = permission;
71    this.__isset.permission = true;
72    this.owner = owner;
73    this.__isset.owner = true;
74    this.group = group;
75    this.__isset.group = true;
76  }
77
78  public boolean equals(Object that) {
79    if (that == null)
80      return false;
81    if (that instanceof FileStatus)
82      return this.equals((FileStatus)that);
83    return false;
84  }
85
86  public boolean equals(FileStatus that) {
87    if (that == null)
88      return false;
89
90    boolean this_present_path = true && (this.path != null);
91    boolean that_present_path = true && (that.path != null);
92    if (this_present_path || that_present_path) {
93      if (!(this_present_path && that_present_path))
94        return false;
95      if (!this.path.equals(that.path))
96        return false;
97    }
98
99    boolean this_present_length = true;
100    boolean that_present_length = true;
101    if (this_present_length || that_present_length) {
102      if (!(this_present_length && that_present_length))
103        return false;
104      if (this.length != that.length)
105        return false;
106    }
107
108    boolean this_present_isdir = true;
109    boolean that_present_isdir = true;
110    if (this_present_isdir || that_present_isdir) {
111      if (!(this_present_isdir && that_present_isdir))
112        return false;
113      if (this.isdir != that.isdir)
114        return false;
115    }
116
117    boolean this_present_block_replication = true;
118    boolean that_present_block_replication = true;
119    if (this_present_block_replication || that_present_block_replication) {
120      if (!(this_present_block_replication && that_present_block_replication))
121        return false;
122      if (this.block_replication != that.block_replication)
123        return false;
124    }
125
126    boolean this_present_blocksize = true;
127    boolean that_present_blocksize = true;
128    if (this_present_blocksize || that_present_blocksize) {
129      if (!(this_present_blocksize && that_present_blocksize))
130        return false;
131      if (this.blocksize != that.blocksize)
132        return false;
133    }
134
135    boolean this_present_modification_time = true;
136    boolean that_present_modification_time = true;
137    if (this_present_modification_time || that_present_modification_time) {
138      if (!(this_present_modification_time && that_present_modification_time))
139        return false;
140      if (this.modification_time != that.modification_time)
141        return false;
142    }
143
144    boolean this_present_permission = true && (this.permission != null);
145    boolean that_present_permission = true && (that.permission != null);
146    if (this_present_permission || that_present_permission) {
147      if (!(this_present_permission && that_present_permission))
148        return false;
149      if (!this.permission.equals(that.permission))
150        return false;
151    }
152
153    boolean this_present_owner = true && (this.owner != null);
154    boolean that_present_owner = true && (that.owner != null);
155    if (this_present_owner || that_present_owner) {
156      if (!(this_present_owner && that_present_owner))
157        return false;
158      if (!this.owner.equals(that.owner))
159        return false;
160    }
161
162    boolean this_present_group = true && (this.group != null);
163    boolean that_present_group = true && (that.group != null);
164    if (this_present_group || that_present_group) {
165      if (!(this_present_group && that_present_group))
166        return false;
167      if (!this.group.equals(that.group))
168        return false;
169    }
170
171    return true;
172  }
173
174  public int hashCode() {
175    return 0;
176  }
177
178  public void read(TProtocol iprot) throws TException {
179    TField field;
180    iprot.readStructBegin();
181    while (true)
182    {
183      field = iprot.readFieldBegin();
184      if (field.type == TType.STOP) { 
185        break;
186      }
187      switch (field.id)
188      {
189        case 1:
190          if (field.type == TType.STRING) {
191            this.path = iprot.readString();
192            this.__isset.path = true;
193          } else { 
194            TProtocolUtil.skip(iprot, field.type);
195          }
196          break;
197        case 2:
198          if (field.type == TType.I64) {
199            this.length = iprot.readI64();
200            this.__isset.length = true;
201          } else { 
202            TProtocolUtil.skip(iprot, field.type);
203          }
204          break;
205        case 3:
206          if (field.type == TType.BOOL) {
207            this.isdir = iprot.readBool();
208            this.__isset.isdir = true;
209          } else { 
210            TProtocolUtil.skip(iprot, field.type);
211          }
212          break;
213        case 4:
214          if (field.type == TType.I16) {
215            this.block_replication = iprot.readI16();
216            this.__isset.block_replication = true;
217          } else { 
218            TProtocolUtil.skip(iprot, field.type);
219          }
220          break;
221        case 5:
222          if (field.type == TType.I64) {
223            this.blocksize = iprot.readI64();
224            this.__isset.blocksize = true;
225          } else { 
226            TProtocolUtil.skip(iprot, field.type);
227          }
228          break;
229        case 6:
230          if (field.type == TType.I64) {
231            this.modification_time = iprot.readI64();
232            this.__isset.modification_time = true;
233          } else { 
234            TProtocolUtil.skip(iprot, field.type);
235          }
236          break;
237        case 7:
238          if (field.type == TType.STRING) {
239            this.permission = iprot.readString();
240            this.__isset.permission = true;
241          } else { 
242            TProtocolUtil.skip(iprot, field.type);
243          }
244          break;
245        case 8:
246          if (field.type == TType.STRING) {
247            this.owner = iprot.readString();
248            this.__isset.owner = true;
249          } else { 
250            TProtocolUtil.skip(iprot, field.type);
251          }
252          break;
253        case 9:
254          if (field.type == TType.STRING) {
255            this.group = iprot.readString();
256            this.__isset.group = true;
257          } else { 
258            TProtocolUtil.skip(iprot, field.type);
259          }
260          break;
261        default:
262          TProtocolUtil.skip(iprot, field.type);
263          break;
264      }
265      iprot.readFieldEnd();
266    }
267    iprot.readStructEnd();
268  }
269
270  public void write(TProtocol oprot) throws TException {
271    TStruct struct = new TStruct("FileStatus");
272    oprot.writeStructBegin(struct);
273    TField field = new TField();
274    if (this.path != null) {
275      field.name = "path";
276      field.type = TType.STRING;
277      field.id = 1;
278      oprot.writeFieldBegin(field);
279      oprot.writeString(this.path);
280      oprot.writeFieldEnd();
281    }
282    field.name = "length";
283    field.type = TType.I64;
284    field.id = 2;
285    oprot.writeFieldBegin(field);
286    oprot.writeI64(this.length);
287    oprot.writeFieldEnd();
288    field.name = "isdir";
289    field.type = TType.BOOL;
290    field.id = 3;
291    oprot.writeFieldBegin(field);
292    oprot.writeBool(this.isdir);
293    oprot.writeFieldEnd();
294    field.name = "block_replication";
295    field.type = TType.I16;
296    field.id = 4;
297    oprot.writeFieldBegin(field);
298    oprot.writeI16(this.block_replication);
299    oprot.writeFieldEnd();
300    field.name = "blocksize";
301    field.type = TType.I64;
302    field.id = 5;
303    oprot.writeFieldBegin(field);
304    oprot.writeI64(this.blocksize);
305    oprot.writeFieldEnd();
306    field.name = "modification_time";
307    field.type = TType.I64;
308    field.id = 6;
309    oprot.writeFieldBegin(field);
310    oprot.writeI64(this.modification_time);
311    oprot.writeFieldEnd();
312    if (this.permission != null) {
313      field.name = "permission";
314      field.type = TType.STRING;
315      field.id = 7;
316      oprot.writeFieldBegin(field);
317      oprot.writeString(this.permission);
318      oprot.writeFieldEnd();
319    }
320    if (this.owner != null) {
321      field.name = "owner";
322      field.type = TType.STRING;
323      field.id = 8;
324      oprot.writeFieldBegin(field);
325      oprot.writeString(this.owner);
326      oprot.writeFieldEnd();
327    }
328    if (this.group != null) {
329      field.name = "group";
330      field.type = TType.STRING;
331      field.id = 9;
332      oprot.writeFieldBegin(field);
333      oprot.writeString(this.group);
334      oprot.writeFieldEnd();
335    }
336    oprot.writeFieldStop();
337    oprot.writeStructEnd();
338  }
339
340  public String toString() {
341    StringBuilder sb = new StringBuilder("FileStatus(");
342    sb.append("path:");
343    sb.append(this.path);
344    sb.append(",length:");
345    sb.append(this.length);
346    sb.append(",isdir:");
347    sb.append(this.isdir);
348    sb.append(",block_replication:");
349    sb.append(this.block_replication);
350    sb.append(",blocksize:");
351    sb.append(this.blocksize);
352    sb.append(",modification_time:");
353    sb.append(this.modification_time);
354    sb.append(",permission:");
355    sb.append(this.permission);
356    sb.append(",owner:");
357    sb.append(this.owner);
358    sb.append(",group:");
359    sb.append(this.group);
360    sb.append(")");
361    return sb.toString();
362  }
363
364}
365
Note: See TracBrowser for help on using the repository browser.