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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum Kewarganegaraan {
    WNI(1, "WNI"),
    WNA(2, "WNA");

    private final long id;

    @Getter
    private final String name;

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