Christian Lavoie | afc6d8f | 2011-02-20 02:39:19 +0000 | [diff] [blame] | 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 thrift |
| 21 | |
| 22 | /** |
| 23 | * Generic base interface for generated Thrift objects. |
| 24 | * |
| 25 | */ |
| 26 | type TBase interface { |
| 27 | |
| 28 | /** |
| 29 | * Reads the TObject from the given input protocol |
| 30 | * |
| 31 | * @param iprot Input protocol |
| 32 | */ |
| 33 | Read(iprot TProtocol) (err TException) |
| 34 | |
| 35 | /** |
| 36 | * Writes the objects out to the protocol |
| 37 | * |
| 38 | * @param oprot Output protocol |
| 39 | */ |
| 40 | Write(oprot TProtocol) (err TException) |
| 41 | |
| 42 | /** |
| 43 | * Check if a field is currently set or unset. |
| 44 | * |
| 45 | * @param field |
| 46 | */ |
| 47 | IsSet(field TField) bool |
| 48 | |
| 49 | /** |
| 50 | * Get a field's value by field variable. Primitive types will be wrapped in |
| 51 | * the appropriate "boxed" types. |
| 52 | * |
| 53 | * @param field |
| 54 | */ |
| 55 | FieldValue(field TField) interface{} |
| 56 | |
| 57 | /** |
| 58 | * Set a field's value by field variable. Primitive types must be "boxed" in |
| 59 | * the appropriate object wrapper type. |
| 60 | * |
| 61 | * @param field |
| 62 | */ |
| 63 | SetFieldValue(field TField, value interface{}) |
| 64 | |
| 65 | DeepCopy() TBase |
| 66 | } |