3 import java.util.HashMap;
5 import org.apache.commons.lang.Validate;
7 import com.google.common.collect.Maps;
41 private static final HashMap<String, Art> BY_NAME = Maps.newHashMap();
42 private static final HashMap<Integer, Art> BY_ID = Maps.newHashMap();
44 private Art(
int id,
int width,
int height) {
96 Validate.notNull(name,
"Name cannot be null");
98 return BY_NAME.get(name.toLowerCase().replaceAll(
"_",
""));
102 for (
Art art : values()) {
103 BY_ID.put(art.id, art);
104 BY_NAME.put(art.toString().toLowerCase().replaceAll(
"_",
""), art);