package com.unibuy.smartdevice.structure;

import org.json.JSONObject;

public class SlotStructure {
    private int field;
    private int slot;
    private ProductStructure product;
    private int count;
    private boolean lock;
    private int secord;
    private JSONObject otherData;

    /*
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("key", apiKey);
        jsonObject.put("machine", MachineName);
        jsonObject.put("tid", trackID + "");
        jsonObject.put(TPDNetworkConstants.ARG_SAMSUNG_PAY_PRIME_TYPE, type);
        String receive = DoPut(DomainName + "products/exp/B025", jsonObject.toString());
     */

    public SlotStructure(int field, int slot, ProductStructure product, int count, boolean lock, JSONObject otherData) {
        this.field = field;
        this.slot = slot;
        this.product = product;
        this.count = count;
        this.lock = lock;
        this.secord = 0;
        this.otherData = otherData;
    }

    @Override
    public String toString() {
        return "SlotStructure{" +
                "field=" + field +
                ", slot=" + slot +
                ", product=" + (product != null ? product.toString() : "null") +
                ", count=" + count +
                ", lock=" + lock +
                ", secord=" + secord +
                ", otherData=" + (otherData != null ? otherData.toString() : "{}") +
                '}';
    }

    public SlotStructure(int field, int slot, ProductStructure product, int count, boolean lock) {
        this(field, slot, product, count, lock, new JSONObject());
    }

    public SlotStructure(int field, int slot, ProductStructure product, int count) {
        this(field, slot, product, count, false, new JSONObject());
    }

    public int getField() {
        return field;
    }

    public void setField(int field) {
        this.field = field;
    }

    public int getSlot() {
        return this.slot;
    }
    public void setSlot(int slot) {
        this.slot = slot;
    }

    public int getCount() {
        return count;
    }
    public void setCount(int count) {
        this.count = count;
    }

    public boolean isLock() {
        return lock;
    }
    public void setLock(boolean lock) {
        this.lock = lock;
    }

    public int getSecord() {
        return secord;
    }

    public void setSecord(int secord) {
        this.secord = secord;
    }

    public ProductStructure getProduct() {
        return this.product;
    }
    public void setProduct(ProductStructure product) {
        this.product = product;
    }

    public JSONObject getOtherData() {
        return otherData;
    }

    public void setOtherData(JSONObject otherData) {
        this.otherData = otherData;
    }
}
