package ch.pizzalemon.android.model.menu;

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

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by cimenmus on 08/10/2017.
 */

public class MenuProductOptionModel implements Serializable {

    @Expose @SerializedName("product_option_id")
    private String productOptionId;

    @Expose @SerializedName("option_id")
    private String optionId;

    @Expose @SerializedName("product_option_value")
    private ArrayList<MenuProductOptionValueModel> optionValueModelList;

    private String name;
    private String value;
    private String type;
    private String required;
    private int order;

    private void checkNull(){

        if(productOptionId == null)
            productOptionId = "";

        if(optionId == null)
            optionId = "";

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

        if(value == null)
            value = "";

        if(type == null)
            type = "";

        if(required == null)
            required = "";

        if(optionValueModelList != null){
            MenuProductOptionValueModel.checkNull(optionValueModelList);
        }
    }

    public static void checkNull(ArrayList<MenuProductOptionModel> menuProductOptionModels){
        for(MenuProductOptionModel menuProductOptionModel : menuProductOptionModels){
            menuProductOptionModel.checkNull();
        }
    }

    public String getProductOptionId() {
        return productOptionId;
    }

    public void setProductOptionId(String productOptionId) {
        this.productOptionId = productOptionId;
    }

    public String getOptionId() {
        return optionId;
    }

    public void setOptionId(String optionId) {
        this.optionId = optionId;
    }

    public ArrayList<MenuProductOptionValueModel> getOptionValueModelList() {
        return optionValueModelList;
    }

    public void setOptionValueModelList(ArrayList<MenuProductOptionValueModel> optionValueModelList) {
        this.optionValueModelList = optionValueModelList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRequired() {
        return required;
    }

    public void setRequired(String required) {
        this.required = required;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }
}
