yeg
5 天以前 691f882740b46c5354fb33404fef6efb370e05dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.battery.device.api.model;
 
import java.math.BigDecimal;
import java.util.Objects;
 
/** 设备返回的计划工步,只用于观测和展示,不属于测试配置。 */
public record PlannedStep(int stepNo, String stepType, String name, BigDecimal targetVoltageV,
        BigDecimal targetCurrentA, Long durationSeconds)
{
    public PlannedStep
    {
        if (stepNo < 1) throw new IllegalArgumentException("stepNo must be positive");
        stepType = Objects.requireNonNull(stepType, "stepType").trim();
        if (stepType.isEmpty()) throw new IllegalArgumentException("stepType must not be blank");
        name = name == null ? null : name.trim();
        if (durationSeconds != null && durationSeconds < 0)
            throw new IllegalArgumentException("durationSeconds must be non-negative");
    }
}