package com.red.circle.other.inner.enums.material;

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

/**
 * 货币类型.
 *
 * @author pengliang on 2021/5/19
 */
public enum PropsCurrencyType {

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

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

  /**
   * 免费.
   */
  FREE("Free");

  private final String desc;

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

  public String getDesc() {
    return desc;
  }

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

}
