package com.yonge.cooleshow.biz.dal.enums.course;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;

/**
 * 课程关联曲目、专辑类型
 * @author: Eric
 * @date: 2022-03-30
 */
public enum RelationMusicAlbumEnum implements BaseEnum<String, RelationMusicAlbumEnum> {

    MUSIC("曲目"),
    ALBUM("专辑"),
    ;

    @EnumValue
    private String code;
    private String msg;

    RelationMusicAlbumEnum(String msg) {
        this.code = this.name();
        this.msg = msg;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getCode() {
        return code;
    }

    /**
     * 类型匹配
     * @param name 类型
     * @return boolean
     */
    public static boolean match(String name) {

        RelationMusicAlbumEnum[] values = RelationMusicAlbumEnum.values();
        for (RelationMusicAlbumEnum item : values) {

            if (item.name().equals(name)) {
                return true;
            }
        }

        return false;
    }
}
