// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.data.cosmos.serialization.hybridrow.perf.cassandrahotel.protobuf;

import com.azure.data.cosmos.serialization.hybridrow.perf.*;

// <auto-generated>
//     Generated by the protocol buffer compiler.  DO NOT EDIT!
//     source: TestData/CassandraHotelSchema.proto
// </auto-generated>

//C# TO JAVA CONVERTER NOTE: There is no Java equivalent to C# namespace aliases:
//using pb = Google.Protobuf;
//C# TO JAVA CONVERTER NOTE: There is no Java equivalent to C# namespace aliases:
//using pbc = Google.Protobuf.Collections;
//C# TO JAVA CONVERTER NOTE: There is no Java equivalent to C# namespace aliases:
//using pbr = Google.Protobuf.Reflection;

public final class Guests implements Google.Protobuf.IMessage<Guests> {
    /**
     * Field number for the "addresses" field.
     */
    public static final int AddressesFieldNumber = 7;
    /**
     * Field number for the "confirm_number" field.
     */
    public static final int ConfirmNumberFieldNumber = 8;
    /**
     * Field number for the "emails" field.
     */
    public static final int EmailsFieldNumber = 5;
    /**
     * Field number for the "first_name" field.
     */
    public static final int FirstNameFieldNumber = 2;
    /**
     * Field number for the "guest_id" field.
     */
    public static final int GuestIdFieldNumber = 1;
    /**
     * Field number for the "last_name" field.
     */
    public static final int LastNameFieldNumber = 3;

    // TODO: C# TO JAVA CONVERTER: Java does not support 'partial' methods:
    //	partial void OnConstruction();
    /**
     * Field number for the "phone_numbers" field.
     */
    public static final int PhoneNumbersFieldNumber = 6;
    /**
     * Field number for the "title" field.
     */
    public static final int TitleFieldNumber = 4;
    private static final Google.Protobuf.Collections.MapField<String, Address>.Codec _map_addresses_codec =
        new Google.Protobuf.Collections.MapField<String, Address>.Codec(Google.Protobuf.FieldCodec.ForString(10),
            Google.Protobuf.FieldCodec.ForMessage(18,
                Address.getParser()), 58);
    private static final Google.Protobuf.MessageParser<Guests> _parser =
        new Google.Protobuf.MessageParser<Guests>(() -> new Guests());
    private static final Google.Protobuf.FieldCodec<String> _repeated_emails_codec =
        Google.Protobuf.FieldCodec.ForString(42);
    private static final Google.Protobuf.FieldCodec<String> _repeated_phoneNumbers_codec =
        Google.Protobuf.FieldCodec.ForString(50);
    private static final Google.Protobuf.FieldCodec<String> _single_confirmNumber_codec =
        Google.Protobuf.FieldCodec.<String>ForClassWrapper(66);
    private static final Google.Protobuf.FieldCodec<String> _single_firstName_codec =
        Google.Protobuf.FieldCodec.<String>ForClassWrapper(18);
    private static final Google.Protobuf.FieldCodec<String> _single_guestId_codec =
        Google.Protobuf.FieldCodec.<String>ForClassWrapper(10);
    private static final Google.Protobuf.FieldCodec<String> _single_lastName_codec =
        Google.Protobuf.FieldCodec.<String>ForClassWrapper(26);
    private static final Google.Protobuf.FieldCodec<String> _single_title_codec =
        Google.Protobuf.FieldCodec.<String>ForClassWrapper(34);
    private final Google.Protobuf.Collections.MapField<String, Address> addresses_ =
        new Google.Protobuf.Collections.MapField<String, Address>();
    private final Google.Protobuf.Collections.RepeatedField<String> emails_ =
        new Google.Protobuf.Collections.RepeatedField<String>();
    private final Google.Protobuf.Collections.RepeatedField<String> phoneNumbers_ =
        new Google.Protobuf.Collections.RepeatedField<String>();
    private Google.Protobuf.UnknownFieldSet _unknownFields;
    private String confirmNumber_;
    private String firstName_;
    private String guestId_;
    private String lastName_;
    private String title_;

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Guests()
    public Guests() {
        OnConstruction();
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Guests(Guests other)
    public Guests(Guests other) {
        this();
        setGuestId(other.getGuestId());
        setFirstName(other.getFirstName());
        setLastName(other.getLastName());
        setTitle(other.getTitle());
        emails_ = other.emails_.Clone();
        phoneNumbers_ = other.phoneNumbers_.Clone();
        addresses_ = other.addresses_.Clone();
        setConfirmNumber(other.getConfirmNumber());
        _unknownFields = Google.Protobuf.UnknownFieldSet.Clone(other._unknownFields);
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Google.Protobuf.Collections
    // .MapField<string, azure.data.cosmos.serialization.hybridrow.perf.cassandrahotel.Protobuf.Address>
    // Addresses
    public Google.Protobuf.Collections.MapField<String, Address> getAddresses() {
        return addresses_;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public string ConfirmNumber
    public String getConfirmNumber() {
        return confirmNumber_;
    }

    public void setConfirmNumber(String value) {
        confirmNumber_ = value;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public static Google.Protobuf.Reflection
    // .MessageDescriptor Descriptor
    public static Google.Protobuf.Reflection.MessageDescriptor getDescriptor() {
        return CassandraHotelSchemaReflection.getDescriptor().MessageTypes[4];
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor
    public Google.Protobuf.Reflection getDescriptor() {
        return getDescriptor();
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Google.Protobuf.Collections
    // .RepeatedField<string> Emails
    public Google.Protobuf.Collections.RepeatedField<String> getEmails() {
        return emails_;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public string FirstName
    public String getFirstName() {
        return firstName_;
    }

    public void setFirstName(String value) {
        firstName_ = value;
    }

    /**
     * guid
     */
    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public string GuestId
    public String getGuestId() {
        return guestId_;
    }

    public void setGuestId(String value) {
        guestId_ = value;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public string LastName
    public String getLastName() {
        return lastName_;
    }

    public void setLastName(String value) {
        lastName_ = value;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public static Google.Protobuf
    // .MessageParser<Guests> Parser
    public static Google.Protobuf.MessageParser<Guests> getParser() {
        return _parser;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Google.Protobuf.Collections
    // .RepeatedField<string> PhoneNumbers
    public Google.Protobuf.Collections.RepeatedField<String> getPhoneNumbers() {
        return phoneNumbers_;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public string Title
    public String getTitle() {
        return title_;
    }

    public void setTitle(String value) {
        title_ = value;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize()
    public int CalculateSize() {
        int size = 0;
        if (guestId_ != null) {
            size += _single_guestId_codec.CalculateSizeWithTag(getGuestId());
        }
        if (firstName_ != null) {
            size += _single_firstName_codec.CalculateSizeWithTag(getFirstName());
        }
        if (lastName_ != null) {
            size += _single_lastName_codec.CalculateSizeWithTag(getLastName());
        }
        if (title_ != null) {
            size += _single_title_codec.CalculateSizeWithTag(getTitle());
        }
        size += emails_.CalculateSize(_repeated_emails_codec);
        size += phoneNumbers_.CalculateSize(_repeated_phoneNumbers_codec);
        size += addresses_.CalculateSize(_map_addresses_codec);
        if (confirmNumber_ != null) {
            size += _single_confirmNumber_codec.CalculateSizeWithTag(getConfirmNumber());
        }
        if (_unknownFields != null) {
            size += _unknownFields.CalculateSize();
        }
        return size;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public Guests Clone()
    public Guests Clone() {
        return new Guests(this);
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Guests other)
    public void MergeFrom(Guests other) {
        if (other == null) {
            return;
        }
        if (other.guestId_ != null) {
            if (guestId_ == null || !other.getGuestId().equals("")) {
                setGuestId(other.getGuestId());
            }
        }
        if (other.firstName_ != null) {
            if (firstName_ == null || !other.getFirstName().equals("")) {
                setFirstName(other.getFirstName());
            }
        }
        if (other.lastName_ != null) {
            if (lastName_ == null || !other.getLastName().equals("")) {
                setLastName(other.getLastName());
            }
        }
        if (other.title_ != null) {
            if (title_ == null || !other.getTitle().equals("")) {
                setTitle(other.getTitle());
            }
        }
        emails_.Add(other.emails_);
        phoneNumbers_.Add(other.phoneNumbers_);
        addresses_.Add(other.addresses_);
        if (other.confirmNumber_ != null) {
            if (confirmNumber_ == null || !other.getConfirmNumber().equals("")) {
                setConfirmNumber(other.getConfirmNumber());
            }
        }
        _unknownFields = Google.Protobuf.UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Google.Protobuf
    // .CodedInputStream input)
    public void MergeFrom(Google.Protobuf.CodedInputStream input) {
        //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
        //ORIGINAL LINE: uint tag;
        int tag;
        while ((tag = input.ReadTag()) != 0) {
            switch (tag) {
                default:
                    _unknownFields = Google.Protobuf.UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;
                case 10: {
                    String value = _single_guestId_codec.Read(input);
                    if (guestId_ == null || !value.equals("")) {
                        setGuestId(value);
                    }
                    break;
                }
                case 18: {
                    String value = _single_firstName_codec.Read(input);
                    if (firstName_ == null || !value.equals("")) {
                        setFirstName(value);
                    }
                    break;
                }
                case 26: {
                    String value = _single_lastName_codec.Read(input);
                    if (lastName_ == null || !value.equals("")) {
                        setLastName(value);
                    }
                    break;
                }
                case 34: {
                    String value = _single_title_codec.Read(input);
                    if (title_ == null || !value.equals("")) {
                        setTitle(value);
                    }
                    break;
                }
                case 42: {
                    emails_.AddEntriesFrom(input, _repeated_emails_codec);
                    break;
                }
                case 50: {
                    phoneNumbers_.AddEntriesFrom(input, _repeated_phoneNumbers_codec);
                    break;
                }
                case 58: {
                    addresses_.AddEntriesFrom(input, _map_addresses_codec);
                    break;
                }
                case 66: {
                    String value = _single_confirmNumber_codec.Read(input);
                    if (confirmNumber_ == null || !value.equals("")) {
                        setConfirmNumber(value);
                    }
                    break;
                }
            }
        }
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(Google.Protobuf
    // .CodedOutputStream output)
    public void WriteTo(Google.Protobuf.CodedOutputStream output) {
        if (guestId_ != null) {
            _single_guestId_codec.WriteTagAndValue(output, getGuestId());
        }
        if (firstName_ != null) {
            _single_firstName_codec.WriteTagAndValue(output, getFirstName());
        }
        if (lastName_ != null) {
            _single_lastName_codec.WriteTagAndValue(output, getLastName());
        }
        if (title_ != null) {
            _single_title_codec.WriteTagAndValue(output, getTitle());
        }
        emails_.WriteTo(output, _repeated_emails_codec);
        phoneNumbers_.WriteTo(output, _repeated_phoneNumbers_codec);
        addresses_.WriteTo(output, _map_addresses_codec);
        if (confirmNumber_ != null) {
            _single_confirmNumber_codec.WriteTagAndValue(output, getConfirmNumber());
        }
        if (_unknownFields != null) {
            _unknownFields.WriteTo(output);
        }
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other)
    @Override
    public boolean equals(Object other) {
        return Equals(other instanceof Guests ? (Guests)other : null);
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Guests other)
    public boolean equals(Guests other) {
        if (ReferenceEquals(other, null)) {
            return false;
        }
        if (ReferenceEquals(other, this)) {
            return true;
        }
        if (!getGuestId().equals(other.getGuestId())) {
            return false;
        }
        if (!getFirstName().equals(other.getFirstName())) {
            return false;
        }
        if (!getLastName().equals(other.getLastName())) {
            return false;
        }
        if (!getTitle().equals(other.getTitle())) {
            return false;
        }
        if (!emails_.equals(other.emails_)) {
            return false;
        }
        if (!phoneNumbers_.equals(other.phoneNumbers_)) {
            return false;
        }
        if (!getAddresses().equals(other.getAddresses())) {
            return false;
        }
        if (!getConfirmNumber().equals(other.getConfirmNumber())) {
            return false;
        }
        return Equals(_unknownFields, other._unknownFields);
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode()
    @Override
    public int hashCode() {
        int hash = 1;
        if (guestId_ != null) {
            hash ^= getGuestId().hashCode();
        }
        if (firstName_ != null) {
            hash ^= getFirstName().hashCode();
        }
        if (lastName_ != null) {
            hash ^= getLastName().hashCode();
        }
        if (title_ != null) {
            hash ^= getTitle().hashCode();
        }
        hash ^= emails_.hashCode();
        hash ^= phoneNumbers_.hashCode();
        hash ^= getAddresses().hashCode();
        if (confirmNumber_ != null) {
            hash ^= getConfirmNumber().hashCode();
        }
        if (_unknownFields != null) {
            hash ^= _unknownFields.hashCode();
        }
        return hash;
    }

    // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
    //ORIGINAL LINE: [System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString()
    @Override
    public String toString() {
        return Google.Protobuf.JsonFormatter.ToDiagnosticString(this);
    }

}