package com.example.beijing_daxing.vm;

import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;

import androidx.databinding.BaseObservable;

import com.example.beijing_daxing.been.BaseLocation;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wanghao
 * @date 2024/1/26  15:32
 */
public class FpInVm extends BaseObservable {
    private String epc;
    private String bichCode;
    private String location;
    private String locationCode;
    private String state;
    private String time;
    private String submitCode;
    private List<String> list;

    public void selectLocation(AdapterView<?> parent, View view, int position, long id) {
        this.submitCode=list.get(position);
    }


    public String getSubmitCode() {
        return submitCode;
    }

    public List<String> getList() {
        return list;
    }

    public void setList(List<BaseLocation> list1) {
        list=new ArrayList<>();
        list1.forEach(t -> this.list.add(t.getLocationCode()));
        notifyChange();
    }

    public String getEpc() {
        return epc;
    }

    public void setEpc(String epc) {
        this.epc = epc;
        notifyChange();
    }

    public String getBichCode() {
        return bichCode;
    }

    public void setBichCode(String bichCode) {
        this.bichCode = bichCode;
        notifyChange();
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
        notifyChange();
    }

    public String getLocationCode() {
        return locationCode;
    }

    public void setLocationCode(String locationCode) {
        this.locationCode = locationCode;
        notifyChange();
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
        notifyChange();
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
        notifyChange();
    }

    @Override
    public String toString() {
        return "FpInVm{" +
                "epc='" + epc + '\'' +
                ", bichCode='" + bichCode + '\'' +
                ", location='" + location + '\'' +
                ", locationCode='" + locationCode + '\'' +
                ", state='" + state + '\'' +
                ", time='" + time + '\'' +
                ", submitCode='" + submitCode + '\'' +
                ", list=" + list +
                '}';
    }
}
