package org.ofbiz.product.product;

import java.util.HashMap;
import java.util.Map;

/*
 <option key="SGL" description="Single" />
 <option key="DBL" description="Double" />
 <option key="TWN" description="Twin" />
 <option key="FML" description="Family" />
 <option key="JRS" description="Junior Suite" />
 <option key="SRS" description="Senior Suite" />

 */
public class RoomType {

    public static final RoomType DBL = new RoomType("DBL", "Double");

    public static final RoomType DEFAULT = DBL;

    public static final RoomType FML = new RoomType("FML", "Family");

    public static final RoomType JRS = new RoomType("JRS", "Junior Suite");

    public static final RoomType SGL = new RoomType("SGL", "Single");

    public static final RoomType SRS = new RoomType("SRS", "Senior Suite");

    public static final RoomType TWN = new RoomType("TWN", "Twin");

    private static Map types;

    private String description;

    private String key;

    private RoomType(String key, String description) {
        this.key = key;
        this.description = description;
        getTypes().put(this.key, this);
    }

    public String getDescription() {
        return description;
    }

    public String getKey() {
        return key;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String toString() {
        return description;
    }

    public static Map getTypes() {
        if(types==null){
            types = new HashMap();
        }
        return types;
    }
}
