package com.assimilate.alltrans.model;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import com.google.gson.annotations.SerializedName;

public class Language implements Parcelable {
    @SerializedName("language")
    private String mLanguage;
    @SerializedName("languageCode")
    private String mLanguageCode;
    @SerializedName("speechCode")
    private String mSpeechCode;
    public String mFlagUrl;

    public Language() {
    }

    public Language(String language, String languageCode, String speechCode) {
        this.mLanguage = language;
        this.mLanguageCode = languageCode;
        this.mSpeechCode = speechCode;
        this.mFlagUrl = null;
    }

    public Language(String language, String languageCode, String speechCode, String flagUrl) {
        this.mLanguage = language;
        this.mLanguageCode = languageCode;
        this.mSpeechCode = speechCode;
        this.mFlagUrl = flagUrl;
    }

    protected Language(Parcel in) {
        mLanguage = in.readString();
        mLanguageCode = in.readString();
        mSpeechCode = in.readString();
        mFlagUrl = in.readString();
    }

    public static final Creator<Language> CREATOR = new Creator<Language>() {
        @Override
        public Language createFromParcel(Parcel in) {
            return new Language(in);
        }

        @Override
        public Language[] newArray(int size) {
            return new Language[size];
        }
    };

    public String getLanguage() {
        return mLanguage;
    }

    public String getLanguageCode() {
        return mLanguageCode;
    }

    public String getSpeechCode() {
        return mSpeechCode;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int i) {
        parcel.writeString(mLanguage);
        parcel.writeString(mLanguageCode);
        parcel.writeString(mSpeechCode);
        parcel.writeString(mFlagUrl);
    }
}
