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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum StatusPasien {
    SEHAT(1, "Sehat"),
    MENINGGAL(2, "Meninggal");

    private final long id;

    @Getter
    private final String name;

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