package cn.iocoder.yudao.module.energy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum EnergyTypeEnum {
    HYDROGEN(0, "氢费"),
    ELECTRIC(1, "电费"),
    ETC(2, "ETC");

    private final Integer type;
    private final String name;

    public static EnergyTypeEnum valueOf(Integer type) {
        return Arrays.stream(values())
                .filter(item -> item.getType().equals(type))
                .findFirst().orElse(null);
    }
}
