package vut.msa.enums;

import java.util.EnumSet;
import java.util.Map;
import vut.msa.interfaces.SelectItemable;
import vut.msa.interfaces.SelectableEnum;

/**
 * Enumerator pre typ zalohovania v case
 */
public enum BackupSchedule implements SelectableEnum, SelectItemable {

    DAILY ("Denné"),
    WEEKLY ("Týždenné"),
    MOUNTHLY("Mesačné");

    private String name;

    private BackupSchedule(String name) {
        this.name = name;
    }

    public String getId() {return this.name;}
    public String getName() { return this.name;}

    /**
     * Metoda naplni HashMap hodnotami tejto triedy. Sluzi pre vytvorenie
     * zoznamu na JSP stranke.
     *
     * @return mapa s hodnotami enum BackupType
     */
    public Map<String, SelectableEnum> getLookup() {
        for(BackupSchedule type : EnumSet.allOf(BackupSchedule.class))
               lookup.put(type.getName(), type);
        return lookup;
    }
}
