| 30 |
ashish |
1 |
/*
|
|
|
2 |
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
3 |
* or more contributor license agreements. See the NOTICE file
|
|
|
4 |
* distributed with this work for additional information
|
|
|
5 |
* regarding copyright ownership. The ASF licenses this file
|
|
|
6 |
* to you under the Apache License, Version 2.0 (the
|
|
|
7 |
* "License"); you may not use this file except in compliance
|
|
|
8 |
* with the License. You may obtain a copy of the License at
|
|
|
9 |
*
|
|
|
10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
11 |
*
|
|
|
12 |
* Unless required by applicable law or agreed to in writing,
|
|
|
13 |
* software distributed under the License is distributed on an
|
|
|
14 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
15 |
* KIND, either express or implied. See the License for the
|
|
|
16 |
* specific language governing permissions and limitations
|
|
|
17 |
* under the License.
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
package org.apache.thrift;
|
|
|
21 |
|
|
|
22 |
import java.io.Serializable;
|
|
|
23 |
|
|
|
24 |
import org.apache.thrift.protocol.TProtocol;
|
|
|
25 |
|
|
|
26 |
/**
|
|
|
27 |
* Generic base interface for generated Thrift objects.
|
|
|
28 |
*
|
|
|
29 |
*/
|
|
|
30 |
public interface TBase<F extends TFieldIdEnum> extends Serializable {
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* Reads the TObject from the given input protocol.
|
|
|
34 |
*
|
|
|
35 |
* @param iprot Input protocol
|
|
|
36 |
*/
|
|
|
37 |
public void read(TProtocol iprot) throws TException;
|
|
|
38 |
|
|
|
39 |
/**
|
|
|
40 |
* Writes the objects out to the protocol
|
|
|
41 |
*
|
|
|
42 |
* @param oprot Output protocol
|
|
|
43 |
*/
|
|
|
44 |
public void write(TProtocol oprot) throws TException;
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
* Check if a field is currently set or unset.
|
|
|
48 |
*
|
|
|
49 |
* @param fieldId The field's id tag as found in the IDL.
|
|
|
50 |
*/
|
|
|
51 |
@Deprecated
|
|
|
52 |
public boolean isSet(int fieldId);
|
|
|
53 |
|
|
|
54 |
/**
|
|
|
55 |
* Check if a field is currently set or unset.
|
|
|
56 |
*
|
|
|
57 |
* @param field
|
|
|
58 |
*/
|
|
|
59 |
public boolean isSet(F field);
|
|
|
60 |
|
|
|
61 |
/**
|
|
|
62 |
* Get a field's value by id. Primitive types will be wrapped in the
|
|
|
63 |
* appropriate "boxed" types.
|
|
|
64 |
*
|
|
|
65 |
* @param fieldId The field's id tag as found in the IDL.
|
|
|
66 |
*/
|
|
|
67 |
@Deprecated
|
|
|
68 |
public Object getFieldValue(int fieldId);
|
|
|
69 |
|
|
|
70 |
/**
|
|
|
71 |
* Get a field's value by field variable. Primitive types will be wrapped in
|
|
|
72 |
* the appropriate "boxed" types.
|
|
|
73 |
*
|
|
|
74 |
* @param field
|
|
|
75 |
*/
|
|
|
76 |
public Object getFieldValue(F field);
|
|
|
77 |
|
|
|
78 |
/**
|
|
|
79 |
* Set a field's value by id. Primitive types must be "boxed" in the
|
|
|
80 |
* appropriate object wrapper type.
|
|
|
81 |
*
|
|
|
82 |
* @param fieldId The field's id tag as found in the IDL.
|
|
|
83 |
*/
|
|
|
84 |
@Deprecated
|
|
|
85 |
public void setFieldValue(int fieldId, Object value);
|
|
|
86 |
|
|
|
87 |
/**
|
|
|
88 |
* Set a field's value by field variable. Primitive types must be "boxed" in
|
|
|
89 |
* the appropriate object wrapper type.
|
|
|
90 |
*
|
|
|
91 |
* @param field
|
|
|
92 |
*/
|
|
|
93 |
public void setFieldValue(F field, Object value);
|
|
|
94 |
|
|
|
95 |
public TBase<F> deepCopy();
|
|
|
96 |
}
|