package ch.pizzalemon.android.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;

/**
 * Created by cimenmus on 23.10.2017.
 */

public class CountryModel {

    @Expose @SerializedName("country_id") private String id;
    @Expose @SerializedName("iso_code_2") private String isoCode2;
    @Expose @SerializedName("iso_code_3") private String isoCode3;
    @Expose @SerializedName("address_format") private String addressFormat;
    @Expose @SerializedName("postcode_required") private String postcodeRequired;

    private String name;
    private String status;

    private void checkNull(){

        if(id == null)
            id = "";

        if(isoCode2 == null)
            isoCode2 = "";

        if(isoCode3 == null)
            isoCode3 = "";

        if(addressFormat == null)
            addressFormat = "";

        if(postcodeRequired == null)
            postcodeRequired = "";

        if(name == null)
            name = "";

        if(status == null)
            status = "";
    }

    public static void checkNull(ArrayList<CountryModel> countryList){
        for(CountryModel countryModel : countryList){
            countryModel.checkNull();
        }
    }

    public String getId() {
        return id;
    }

    public String getIsoCode2() {
        return isoCode2;
    }

    public String getIsoCode3() {
        return isoCode3;
    }

    public String getAddressFormat() {
        return addressFormat;
    }

    public String getPostcodeRequired() {
        return postcodeRequired;
    }

    public String getName() {
        return name;
    }

    public String getStatus() {
        return status;
    }
}
