package com.hboxs.serialport.util;


import com.hboxs.serialport.frame.CommandFrame;

import java.util.Objects;

public class Order {
    private int what;
    private String maddress;
    private CommandFrame mCommand;

    public Order(int what, String bundle, CommandFrame mCommand) {
        this.what = what;
        maddress = bundle;
        this.mCommand = mCommand;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return what == order.what &&
                maddress.equals(order.maddress);
    }

    @Override
    public int hashCode() {
        return Objects.hash(what, maddress);
    }

    public int getWhat() {
        return what;
    }

    public void setWhat(int what) {
        this.what = what;
    }

    public String getMaddress() {
        return maddress;
    }

    public void setMaddress(String maddress) {
        this.maddress = maddress;
    }

    public CommandFrame getCommand() {
        return mCommand;
    }

    public void setCommand(CommandFrame command) {
        mCommand = command;
    }
}
