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

import lombok.Getter;

/**
 * @author salmanoe
 * @version 1.0.0
 * @since 19/10/2023
 */
public enum StatusPerkawinan {
    BELUM_KAWIN(1, "Belum Kawin"),
    KAWIN(2, "Kawin"),
    CERAI_HIDUP(3, "Cerai Hidup"),
    CERAI_MATI(4, "Cerai Mati");

    private final long id;

    @Getter
    private final String name;

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