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 zalohy
 */
public enum BackupType implements SelectableEnum, SelectItemable {
    FULL ("Plná"),
    INCREMENTAL ("Inkrementálna"),
    DIFFERENTIAL ("Rozdielová");

    private String name;

    private BackupType(String name) {
        this.name = 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(BackupType type : EnumSet.allOf(BackupType.class))
               lookup.put(type.getName(), type);
        return lookup;
    }

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

}
