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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum Agama {
    ISLAM(1, "Islam"),
    KRISTEN(2, "Kristen (Protestan)"),
    KATOLIK(3, "Katolik"),
    HINDU(4, "Hindu"),
    BUDHA(5, "Budha"),
    KONGHUCU(6, "Konghucu");

    private final long id;

    @Getter
    private final String name;

    Agama(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 Agama valueOf(long id) {
        for (Agama agama : values()) {
            if (agama.id == id) {
                return agama;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + id + "]");
    }
}
