KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > model > BallColor


1 package hudson.model;
2
3 /**
4  * Ball color used for the build status indication.
5  *
6  * <p>
7  * There are four basic colors, plus their animated "bouncy" versions.
8  * {@link #ordinal()} is the sort order.
9  *
10  * @author Kohsuke Kawaguchi
11  */

12 public enum BallColor {
13     RED, RED_ANIME, YELLOW, YELLOW_ANIME, BLUE, BLUE_ANIME, GREY, GREY_ANIME;
14
15     /**
16      * Also used as a final name.
17      */

18     public String JavaDoc toString() {
19         return name().toLowerCase();
20     }
21
22     /**
23      * Gets the animated version.
24      */

25     public BallColor anime() {
26         if(name().endsWith("_ANIME")) return this;
27         else return valueOf(name()+"_ANIME");
28     }
29 }
30
Popular Tags