This repository has been archived by the owner on May 25, 2021. It is now read-only.
/
ColumnOrSuperColumn.cs
215 lines (201 loc) · 6.04 KB
/
ColumnOrSuperColumn.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
using FluentCassandra.Thrift.Protocol;
/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
using System;
using System.Text;
namespace FluentCassandra.Apache.Cassandra
{
/// <summary>
/// Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list
/// of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting
/// instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting
/// in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on
/// single query methods that may return either a SuperColumn or Column.
///
/// If the query was on a counter column family, you will either get a counter_column (instead of a column) or a
/// counter_super_column (instead of a super_column)
///
/// @param column. The Column returned by get() or get_slice().
/// @param super_column. The SuperColumn returned by get() or get_slice().
/// @param counter_column. The Counterolumn returned by get() or get_slice().
/// @param counter_super_column. The CounterSuperColumn returned by get() or get_slice().
/// </summary>
#if !SILVERLIGHT
[Serializable]
#endif
public partial class ColumnOrSuperColumn : TBase
{
private Column _column;
private SuperColumn _super_column;
private CounterColumn _counter_column;
private CounterSuperColumn _counter_super_column;
public Column Column
{
get
{
return _column;
}
set
{
__isset.column = true;
this._column = value;
}
}
public SuperColumn Super_column
{
get
{
return _super_column;
}
set
{
__isset.super_column = true;
this._super_column = value;
}
}
public CounterColumn Counter_column
{
get
{
return _counter_column;
}
set
{
__isset.counter_column = true;
this._counter_column = value;
}
}
public CounterSuperColumn Counter_super_column
{
get
{
return _counter_super_column;
}
set
{
__isset.counter_super_column = true;
this._counter_super_column = value;
}
}
public Isset __isset;
#if !SILVERLIGHT
[Serializable]
#endif
public struct Isset {
public bool column;
public bool super_column;
public bool counter_column;
public bool counter_super_column;
}
public ColumnOrSuperColumn() {
}
public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Column = new Column();
Column.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Struct) {
Super_column = new SuperColumn();
Super_column.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.Struct) {
Counter_column = new CounterColumn();
Counter_column.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 4:
if (field.Type == TType.Struct) {
Counter_super_column = new CounterSuperColumn();
Counter_super_column.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
public void Write(TProtocol oprot) {
TStruct struc = new TStruct("ColumnOrSuperColumn");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Column != null && __isset.column) {
field.Name = "column";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Column.Write(oprot);
oprot.WriteFieldEnd();
}
if (Super_column != null && __isset.super_column) {
field.Name = "super_column";
field.Type = TType.Struct;
field.ID = 2;
oprot.WriteFieldBegin(field);
Super_column.Write(oprot);
oprot.WriteFieldEnd();
}
if (Counter_column != null && __isset.counter_column) {
field.Name = "counter_column";
field.Type = TType.Struct;
field.ID = 3;
oprot.WriteFieldBegin(field);
Counter_column.Write(oprot);
oprot.WriteFieldEnd();
}
if (Counter_super_column != null && __isset.counter_super_column) {
field.Name = "counter_super_column";
field.Type = TType.Struct;
field.ID = 4;
oprot.WriteFieldBegin(field);
Counter_super_column.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
public override string ToString() {
StringBuilder sb = new StringBuilder("ColumnOrSuperColumn(");
sb.Append("Column: ");
sb.Append(Column== null ? "<null>" : Column.ToString());
sb.Append(",Super_column: ");
sb.Append(Super_column== null ? "<null>" : Super_column.ToString());
sb.Append(",Counter_column: ");
sb.Append(Counter_column== null ? "<null>" : Counter_column.ToString());
sb.Append(",Counter_super_column: ");
sb.Append(Counter_super_column== null ? "<null>" : Counter_super_column.ToString());
sb.Append(")");
return sb.ToString();
}
}
}