package cn.sikey.mcdisk.enums;

import cn.hutool.core.util.ArrayUtil;
import cn.sikey.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @Author: nelson
 * @Date: 2025/5/29
 * @Description: 相册主题
 */
@AllArgsConstructor
@Getter
public enum PhotoThemeEnum implements IntArrayValuable {
    ORDINARY_PHOTO_ALBUM(0, "普通相册"),
    FAMILY_PHOTO_ALBUM(1, "亲子相册"),
    TRAVEL_ALBUM(2, "旅行相册");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PhotoThemeEnum::getValue).toArray();

    /**
     * value
     */
    private final Integer value;
    /**
     * name
     */
    private final String name;

    public static PhotoThemeEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(photoThemeEnum -> photoThemeEnum.getValue().equals(value), PhotoThemeEnum.values());
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}
