2 * Autogenerated by Thrift
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
8 import java
.util
.ArrayList
;
10 import java
.util
.HashMap
;
12 import java
.util
.HashSet
;
13 import java
.util
.Collections
;
14 import java
.util
.BitSet
;
15 import java
.util
.Arrays
;
16 import com
.facebook
.thrift
.*;
17 import com
.facebook
.thrift
.annotations
.*;
18 import com
.facebook
.thrift
.async
.*;
19 import com
.facebook
.thrift
.meta_data
.*;
20 import com
.facebook
.thrift
.server
.*;
21 import com
.facebook
.thrift
.transport
.*;
22 import com
.facebook
.thrift
.protocol
.*;
24 @SuppressWarnings({ "unused", "serial" })
25 public class Fields
implements TBase
, java
.io
.Serializable
, Cloneable
, Comparable
<Fields
> {
26 private static final TStruct STRUCT_DESC
= new TStruct("Fields");
27 private static final TField INJECTED_FIELD_FIELD_DESC
= new TField("injected_field", TType
.STRING
, (short)100);
29 public String injected_field
;
30 public static final int INJECTED_FIELD
= 100;
32 // isset id assignments
34 public static final Map
<Integer
, FieldMetaData
> metaDataMap
;
37 Map
<Integer
, FieldMetaData
> tmpMetaDataMap
= new HashMap
<Integer
, FieldMetaData
>();
38 tmpMetaDataMap
.put(INJECTED_FIELD
, new FieldMetaData("injected_field", TFieldRequirementType
.DEFAULT
,
39 new FieldValueMetaData(TType
.STRING
)));
40 metaDataMap
= Collections
.unmodifiableMap(tmpMetaDataMap
);
44 FieldMetaData
.addStructMetaDataMap(Fields
.class, metaDataMap
);
51 String injected_field
) {
53 this.injected_field
= injected_field
;
56 public static class Builder
{
57 private String injected_field
;
62 public Builder
setInjected_field(final String injected_field
) {
63 this.injected_field
= injected_field
;
67 public Fields
build() {
68 Fields result
= new Fields();
69 result
.setInjected_field(this.injected_field
);
74 public static Builder
builder() {
79 * Performs a deep copy on <i>other</i>.
81 public Fields(Fields other
) {
82 if (other
.isSetInjected_field()) {
83 this.injected_field
= TBaseHelper
.deepCopy(other
.injected_field
);
87 public Fields
deepCopy() {
88 return new Fields(this);
91 public String
getInjected_field() {
92 return this.injected_field
;
95 public Fields
setInjected_field(String injected_field
) {
96 this.injected_field
= injected_field
;
100 public void unsetInjected_field() {
101 this.injected_field
= null;
104 // Returns true if field injected_field is set (has been assigned a value) and false otherwise
105 public boolean isSetInjected_field() {
106 return this.injected_field
!= null;
109 public void setInjected_fieldIsSet(boolean __value
) {
111 this.injected_field
= null;
115 public void setFieldValue(int fieldID
, Object __value
) {
118 if (__value
== null) {
119 unsetInjected_field();
121 setInjected_field((String
)__value
);
126 throw new IllegalArgumentException("Field " + fieldID
+ " doesn't exist!");
130 public Object
getFieldValue(int fieldID
) {
133 return getInjected_field();
136 throw new IllegalArgumentException("Field " + fieldID
+ " doesn't exist!");
141 public boolean equals(Object _that
) {
146 if (!(_that
instanceof Fields
))
148 Fields that
= (Fields
)_that
;
150 if (!TBaseHelper
.equalsNobinary(this.isSetInjected_field(), that
.isSetInjected_field(), this.injected_field
, that
.injected_field
)) { return false; }
156 public int hashCode() {
157 return Arrays
.deepHashCode(new Object
[] {injected_field
});
161 public int compareTo(Fields other
) {
163 // See java.lang.Comparable docs
164 throw new NullPointerException();
170 int lastComparison
= 0;
172 lastComparison
= Boolean
.valueOf(isSetInjected_field()).compareTo(other
.isSetInjected_field());
173 if (lastComparison
!= 0) {
174 return lastComparison
;
176 lastComparison
= TBaseHelper
.compareTo(injected_field
, other
.injected_field
);
177 if (lastComparison
!= 0) {
178 return lastComparison
;
183 public void read(TProtocol iprot
) throws TException
{
185 iprot
.readStructBegin(metaDataMap
);
188 __field
= iprot
.readFieldBegin();
189 if (__field
.type
== TType
.STOP
) {
195 if (__field
.type
== TType
.STRING
) {
196 this.injected_field
= iprot
.readString();
198 TProtocolUtil
.skip(iprot
, __field
.type
);
202 TProtocolUtil
.skip(iprot
, __field
.type
);
205 iprot
.readFieldEnd();
207 iprot
.readStructEnd();
210 // check for required fields of primitive type, which can't be checked in the validate method
214 public void write(TProtocol oprot
) throws TException
{
217 oprot
.writeStructBegin(STRUCT_DESC
);
218 if (this.injected_field
!= null) {
219 oprot
.writeFieldBegin(INJECTED_FIELD_FIELD_DESC
);
220 oprot
.writeString(this.injected_field
);
221 oprot
.writeFieldEnd();
223 oprot
.writeFieldStop();
224 oprot
.writeStructEnd();
228 public String
toString() {
229 return toString(1, true);
233 public String
toString(int indent
, boolean prettyPrint
) {
234 String indentStr
= prettyPrint ? TBaseHelper
.getIndentedString(indent
) : "";
235 String newLine
= prettyPrint ?
"\n" : "";
236 String space
= prettyPrint ?
" " : "";
237 StringBuilder sb
= new StringBuilder("Fields");
241 boolean first
= true;
243 sb
.append(indentStr
);
244 sb
.append("injected_field");
246 sb
.append(":").append(space
);
247 if (this.getInjected_field() == null) {
250 sb
.append(TBaseHelper
.toString(this.getInjected_field(), indent
+ 1, prettyPrint
));
253 sb
.append(newLine
+ TBaseHelper
.reduceIndent(indentStr
));
255 return sb
.toString();
258 public void validate() throws TException
{
259 // check for required fields