/*
* Copyright (C) 2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package com.facebook.swift.codec;

import com.facebook.swift.codec.*;

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

@ThriftStruct("ThriftStructForTesting")
public final class BasicThriftStruct
{
    @ThriftConstructor
    public BasicThriftStruct(
            @ThriftField(value = 1, name = "foo") final String foo,
            @ThriftField(value = 2, name = "bar") final String bar,
            @ThriftField(value = 3, name = "baz") final String baz,
            @ThriftField(value = 4, name = "qux") final Long qux
    ) {
        this.foo = foo;
        this.bar = bar;
        this.baz = baz;
        this.qux = qux;
    }

    private final String foo;

    @ThriftField(value=1, name="foo")
    public String getFoo() { return foo; }

    private final String bar;

    @ThriftField(value=2, name="bar")
    public String getBar() { return bar; }

    private final String baz;

    @ThriftField(value=3, name="baz")
    public String getBaz() { return baz; }

    private final Long qux;

    @ThriftField(value=4, name="qux")
    public Long getQux() { return qux; }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("foo", foo)
                .add("bar", bar)
                .add("baz", baz)
                .add("qux", qux)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final BasicThriftStruct that = (BasicThriftStruct) o;

        if (!foo.equals(that.foo)) {
            return false;
        }
        if (!bar.equals(that.bar)) {
            return false;
        }
        if (!baz.equals(that.baz)) {
            return false;
        }
        if (qux != that.qux) {
            return false;
        }
        return true;
    }
}
@@ -1,11 +1,12 @@
 /*%0A
+ 
 * Copyri
@@ -33,18 +33,20 @@
 k, Inc.%0A
+ 
 *%0A
+ 
 * Licens
@@ -111,16 +111,17 @@
 you may%0A
+ 
 * not us
@@ -186,16 +186,17 @@
  obtain%0A
+ 
 * a copy
@@ -214,18 +214,20 @@
 ense at%0A
+ 
 *%0A
+ 
 *     ht
@@ -267,18 +267,20 @@
 NSE-2.0%0A
+ 
 *%0A
+ 
 * Unless
@@ -341,16 +341,17 @@
 oftware%0A
+ 
 * distri
@@ -418,16 +418,17 @@
 WITHOUT%0A
+ 
 * WARRAN
@@ -494,16 +494,17 @@
 See the%0A
+ 
 * Licens
@@ -569,16 +569,17 @@
 tations%0A
+ 
 * under 
@@ -595,12 +595,12 @@
 se.%0A
+ 
 */%0A
-%0A
 pack
@@ -2522,8 +2522,9 @@
 %0A    %7D%0A%7D
+%0A

Fix license header