package com.jasamedika.medifirst2000.etl.pasien.constant;

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum Suku {
    JAWA(1, "Jawa"),
    SUNDA(2, "Sunda"),
    MADURA(3, "Madura"),
    MANADO(4, "Manado"),
    BALI(5, "Bali"),
    DAYAK(6, "Dayak"),
    BETAWI(7, "Betawi"),
    TAPANULI(8, "Tapanuli"),
    PAPUA(9, "Papua"),
    AMBON(10, "Ambon"),
    PADANG(11, "Padang"),
    ACEH(12, "Aceh"),
    BUGIS(13, "Bugis"),
    MAKASSAR(14, "Makassar"),
    MELAYU(15, "Melayu"),
    CINA(16, "Cina"),
    ARAB(17, "Arab"),
    KAILI(18, "Kaili");

    private final long id;

    @Getter
    private final String name;

    Suku(long id, String name) {
        this.id = id;
        this.name = name;
    }

    public long id() {
        return this.id;
    }

    @Override
    public String toString() {
        return Long.toString(id);
    }

    public static Suku valueOf(long id) {
        for (Suku suku : values()) {
            if (suku.id == id) {
                return suku;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + id + "]");
    }
}
