/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

package test.fixtures.basic_swift_bean;

import com.facebook.swift.codec.*;
import com.facebook.swift.codec.ThriftField.Requiredness;
import com.facebook.swift.codec.ThriftField.Recursiveness;
import java.util.*;

import static com.google.common.base.MoreObjects.toStringHelper;

@SwiftGenerated
@ThriftStruct("LegacyStruct")
public final class LegacyStruct {
    @ThriftConstructor
    public LegacyStruct(
        @ThriftField(value=1, name="normal", requiredness=Requiredness.NONE) final int normal,
        @ThriftField(value=-1, name="bad", isLegacyId=true, requiredness=Requiredness.NONE) final int bad
    ) {
        this.normal = normal;
        this.bad = bad;
    }
    
    protected LegacyStruct() {
      this.normal = 0;
      this.bad = 0;
    }
    
    public static class Builder {
        private int normal;
    
        public Builder setNormal(int normal) {
            this.normal = normal;
            return this;
        }
        private int bad;
    
        public Builder setBad(int bad) {
            this.bad = bad;
            return this;
        }
    
        public Builder() { }
        public Builder(LegacyStruct other) {
            this.normal = other.normal;
            this.bad = other.bad;
        }
    
        public LegacyStruct build() {
            return new LegacyStruct (
                this.normal,
                this.bad
            );
        }
    }
    
    private final int normal;
    private final int bad;

    
    @ThriftField(value=1, name="normal", requiredness=Requiredness.NONE)
    public int getNormal() { return normal; }
        
    @ThriftField(value=-1, name="bad", isLegacyId=true, requiredness=Requiredness.NONE)
    public int getBad() { return bad; }
    
    @Override
    public String toString() {
        return toStringHelper(this)
            .add("normal", normal)
            .add("bad", bad)
            .toString();
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
    
        LegacyStruct other = (LegacyStruct)o;
    
        return
            Objects.equals(normal, other.normal) &&
            Objects.equals(bad, other.bad) &&
            true;
    }
    
    @Override
    public int hashCode() {
        return Arrays.deepHashCode(new Object[] {
            normal,
            bad
        });
    }
    
}

@@ -526,108 +526,65 @@
 uct(
-%0A        @ThriftField(value=1, name=%22normal%22, requiredness=Requiredness.NONE) final int normal,
+) %7B%7D%0A%0A    private int normal;%0A    private int bad;%0A
 %0A    
+%0A
     
@@ -594,33 +594,32 @@
 riftField(value=
--
 1, name=%22bad%22, i
@@ -611,37 +611,23 @@
 , name=%22
-bad%22, isLegacyId=true
+normal%22
 , requir
@@ -655,536 +655,77 @@
 ONE)
- final int bad%0A    ) %7B%0A        this.normal = normal;%0A        this.bad = bad;%0A    %7D%0A    %0A    protected LegacyStruct() %7B%0A      this.normal = 0;%0A      this.bad = 0;%0A    %7D%0A    %0A    public static class Builder %7B%0A        private int normal;%0A    %0A        public Builder setNormal(int normal) %7B%0A            this.normal = normal;%0A            return this;%0A        %7D%0A        private int bad;%0A    %0A        public Builder setBad(int bad) %7B%0A            this.bad = bad;%0A            return this;%0A        %7D%0A    %0A        public Builder() %7B %7D%0A    
+%0A    public int getNormal() %7B return normal; %7D%0A    %0A    @ThriftField%0A
     
@@ -735,16 +735,8 @@
 lic 
-Builder(
 Lega
@@ -748,330 +748,93 @@
 uct 
-other) %7B%0A            this.normal = other.normal;%0A            this.bad = other.bad;%0A        %7D%0A    %0A        public LegacyStruct build() %7B%0A            return new LegacyStruct (%0A                this.normal,%0A                this.bad%0A            )
+setNormal(int normal) %7B%0A        this.normal = normal;%0A        return this
 ;%0A    
- 
-   
 %7D%0A    
-%7D%0A    %0A    private final int normal;%0A    private final int bad;%0A%0A
     
@@ -849,32 +849,33 @@
 riftField(value=
+-
 1, name=%22normal%22
@@ -859,39 +859,53 @@
 value=-1, name=%22
-normal%22
+bad%22, isLegacyId=true
 , requiredness=R
@@ -932,38 +932,35 @@
   public int get
-Normal
+Bad
 () %7B return norm
@@ -955,30 +955,23 @@
  return 
-normal; %7D%0A    
+bad; %7D%0A
     %0A   
@@ -987,117 +987,99 @@
 ield
-(value=-1, name=%22bad%22, isLegacyId=true, requiredness=Requiredness.NONE)%0A    public int getBad() %7B return bad;
+%0A    public LegacyStruct setBad(int bad) %7B%0A        this.bad = bad;%0A        return this;%0A   
  %7D%0A 

fix thrift compiler test issue