1 37 package net.sourceforge.cruisecontrol; 38 39 import java.io.ObjectStreamException ; 40 import java.io.Serializable ; 41 import java.util.HashMap ; 42 import java.util.Map ; 43 44 48 public final class ProjectState implements Serializable { 49 private static final Map ALL_STATES = new HashMap (); 50 51 public static final ProjectState QUEUED = 52 new ProjectState(1, "queued", "in build queue"); 53 public static final ProjectState IDLE = 54 new ProjectState(0, "idle", "idle"); 55 public static final ProjectState BOOTSTRAPPING = 56 new ProjectState(2, "bootstrapping", "bootstrapping"); 57 public static final ProjectState MODIFICATIONSET = 58 new ProjectState(3, "modificationset", "checking for modifications"); 59 public static final ProjectState BUILDING = 60 new ProjectState(4, "building", "now building"); 61 public static final ProjectState MERGING_LOGS = 62 new ProjectState(5, "merging", "merging accumulated log files"); 63 public static final ProjectState PUBLISHING = 64 new ProjectState(6, "publishing", "publishing build results"); 65 public static final ProjectState PAUSED = 66 new ProjectState(7, "paused", "paused"); 67 public static final ProjectState STOPPED = 68 new ProjectState(8, "stopped", "stopped"); 69 public static final ProjectState WAITING = 70 new ProjectState(9, "waiting", "waiting for next time to build"); 71 72 private String description; 73 private String name; 74 private int code; 75 76 private ProjectState (int code, String name, String desc) { 77 this.code = code; 78 this.name = name; 79 this.description = desc; 80 ALL_STATES.put(name, this); 81 } 82 83 public String getDescription() { 84 return description; 85 } 86 87 public int getCode() { 88 return code; 89 } 90 91 public String getName() { 92 return name; 93 } 94 95 103 private Object readResolve() throws ObjectStreamException { 104 return ALL_STATES.get(name); 105 } 106 } 107 | Popular Tags |