package com.red.circle.wallet.inner.model.enums;

import com.red.circle.tool.core.text.StringPool;
import java.util.Arrays;
import java.util.Objects;

/**
 * app 货币类型.
 *
 * @author pengliang on 2021/10/11
 */
public enum AppCurrencyTypeEnum {

  /**
   * 金币.
   */
  GOLD("金币"),

  /**
   * 钻石.
   */
  DIAMOND("钻石"),

  /**
   * 豆子.
   */
  BEAN("豆子"),

  /**
   * 游戏券.
   */
  GAME_COUPON("游戏券"),

  ;

  private final String desc;

  AppCurrencyTypeEnum(String desc) {
    this.desc = desc;
  }

  public static String getDescValue(String name) {
    return Arrays.stream(AppCurrencyTypeEnum.values())
        .filter(propsTypeEnum -> Objects.equals(propsTypeEnum.name(), name))
        .findFirst()
        .map(AppCurrencyTypeEnum::getDesc)
        .orElse(StringPool.UNKNOWN);
  }

  public String getDesc() {
    return desc;
  }

}
