ChestShop-3/com/Acrobot/ChestShop/Options/Option.java

40 lines
748 B
Java
Raw Normal View History

2011-06-09 22:54:01 +02:00
package com.Acrobot.ChestShop.Options;
import java.util.HashMap;
import java.util.Map;
/**
* @author Acrobot
*/
public enum Option {
BALANCE(true),
OUT_OF_STOCK(true),
SOMEONE_BOUGHT(true);
private boolean enabled;
private static final Map<String, Option> names = new HashMap<String, Option>();
private Option(boolean enabled) {
this.enabled = enabled;
}
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public static Option getOption(String name) {
return names.get(name);
}
static {
for (Option op : values()) {
names.put(op.name(), op);
}
}
}