package com.smppw.common.pojo;

import java.util.stream.Stream;

// 新公募二级策略
public enum NewPublicSubStrategy implements IStrategy{
    Other(-10000, "其他策略","IN00000008"),
    Initiative(10101, "主动","IN00000008"),
    Passive(10102, "被动","IN00000008"),
    IndexEnhancement(10103, "指数增强","IN00000008"),
    PartialStock(10201, "偏股","IN00000008"),
    Balance(10202, "平衡","IN000002F1"),
    PartialDebt(10203, "偏债","IN0000028F"),
    OrdinaryDebt(10301, "普通债","IN0000028F"),
    ConvertibleBond(10302, "可转债","IN0000028F"),
    Exponential(10303, "指数型","IN0000028F"),
    Monetary(10401, "货币","IN0000007G"),
    FinancialManagement(10402, "理财","IN0000007G"),
    Commodity(10501, "商品","IN0000008S"),
    MarketNeutral(10601, "市场中性","IN00000008"),
    FofPartialStock(10701, "偏股","IN00000008"),
    FofBalance(10702, "平衡","IN000002F1"),
    FofPartialDebt(10703, "偏债","IN0000028F"),
    OverseeInitiative(10801, "主动","IN00000008"),
    OverseePassive(10802, "被动","IN00000008"),
    OverseeIndexEnhancement(10803, "指数增强","IN00000008");

    private final Integer id;
    private final String nameDesc;
    private final String benchmarkId;

    public Integer getId() {
        return id;
    }

    public String getNameDesc() {
        return nameDesc;
    }

    NewPublicSubStrategy(Integer id, String nameDesc,String benchmarkId) {
        this.id = id;
        this.nameDesc = nameDesc;
        this.benchmarkId = benchmarkId;
    }

    public static NewPublicSubStrategy getPublicSubStrategy(int id) {
        return Stream.of(NewPublicSubStrategy.values()).filter(e -> e.id == id).findFirst().orElse(null);
    }

    @Override
    public Integer getStrategyId() {
        return this.getId();
    }

    @Override
    public String getStrategyOriginName() {
        return this.name();
    }

    @Override
    public String getStrategyNameDesc() {
        return this.getNameDesc();
    }

    @Override
    public String getBenchmark() {
        return this.benchmarkId;
    }
}
