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

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

@Getter
@AllArgsConstructor
public enum PayMethodEnum {
    PREPAID(0, "预充值"),
    MONTHLY(1, "月结算");

    private final Integer type;
    private final String name;

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