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

import lombok.Getter;

/**
 * @author Salman
 * @version 1.0.0
 * @since 21 Oct 2023
 */
public enum GolonganResus {
    POSITIF(1, "Resus positif", '+'),
    NEGATIF(2, "Resus negatif", '-');

    private final long id;

    @Getter
    private final String name;

    @Getter
    private final char code;

    GolonganResus(long id, String name, char code) {
        this.id = id;
        this.name = name;
        this.code = code;
    }

    public long id() {
        return this.id;
    }

    @Override
    public String toString() {
        return Long.toString(id);
    }

    public static GolonganResus valueOf(long id) {
        for (GolonganResus golonganResus : values()) {
            if (golonganResus.id == id) {
                return golonganResus;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + id + "]");
    }
}
