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 17/10/2017.
 */

public class ShippingMethodModel {

    private String code;
    private String title;
    private boolean isSelected;

    @Expose
    @SerializedName("cost")
    private double priceDouble;

    @Expose
    @SerializedName("tax_class_id")
    private int taxClassId;

    @Expose
    @SerializedName("text")
    private String priceText;


    private void checkNull(){

        if(code == null)
            code = "";

        if(title == null)
            title = "";

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

    public static void checkNull(ArrayList<ShippingMethodModel> shippingMethodList){
        for(ShippingMethodModel shippingMethodModel : shippingMethodList){
            shippingMethodModel.checkNull();
        }
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isSelected() {
        return isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public double getPriceDouble() {
        return priceDouble;
    }

    public void setPriceDouble(double priceDouble) {
        this.priceDouble = priceDouble;
    }

    public int getTaxClassId() {
        return taxClassId;
    }

    public void setTaxClassId(int taxClassId) {
        this.taxClassId = taxClassId;
    }

    public String getPriceText() {
        return priceText;
    }

    public void setPriceText(String priceText) {
        this.priceText = priceText;
    }
}
