package com.pwt.netty.message2;

import lombok.Getter;
import lombok.Setter;

/**
 * 可用电池统计
 */
@Getter
@Setter
public class AvailableBatteryStats extends BaseData {
    public static final int TOTAL_HOLDER_COUNT = 1;
    public static final int CHARGING_BATTERY_COUNT = 2;
    public static final int AVAILABLE_BATTERY_COUNT = 3;
    public static final int REPAIRING_COUNT = 4;
    /**
     * 总仓位数
     */
    private int totalHolderCount;

    /**
     * 充电中电池个数
     */
    private int chargingBatteryCount;

    /**
     * 可换电电池个数
     */
    private int availableBatteryCount;

    /**
     * 检修中数量
     */
    private int repairingCount;

    public AvailableBatteryStats() {
    }
    public AvailableBatteryStats(int totalHolderCount) {
        this.totalHolderCount = totalHolderCount;
    }

    public AvailableBatteryStats build(int type, int val) {
        if (type == TOTAL_HOLDER_COUNT) {
            this.totalHolderCount = val;
        }
        if (type == CHARGING_BATTERY_COUNT) {
            this.chargingBatteryCount = val;
        }
        if (type == AVAILABLE_BATTERY_COUNT) {
            this.availableBatteryCount = val;
        }
        if (type == REPAIRING_COUNT) {
            this.repairingCount = val;
        }
        return this;
    }
}
