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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum JenisAlamat {
    IDENTITAS(1, "Identitas"),
    DOMISILI(2, "Domisili");

    private final long id;

    @Getter
    private final String name;

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