1 package org.apache.maven.surefire.booter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 public enum Shutdown
30 {
31 DEFAULT( "testset" ),
32 EXIT( "exit" ),
33 KILL( "kill" );
34
35 private final String param;
36
37 Shutdown( String param )
38 {
39 this.param = param;
40 }
41
42 public String getParam()
43 {
44 return param;
45 }
46
47 public static boolean isKnown( String param )
48 {
49 for ( Shutdown shutdown : values() )
50 {
51 if ( shutdown.param.equals( param ) )
52 {
53 return true;
54 }
55 }
56 return false;
57 }
58
59 public static String listParameters()
60 {
61 StringBuilder values = new StringBuilder();
62 for ( Shutdown shutdown : values() )
63 {
64 if ( values.length() != 0 )
65 {
66 values.append( ", " );
67 }
68 values.append( shutdown.getParam() );
69 }
70 return values.toString();
71 }
72
73 public static Shutdown parameterOf( String parameter )
74 {
75 for ( Shutdown shutdown : values() )
76 {
77 if ( shutdown.param.equals( parameter ) )
78 {
79 return shutdown;
80 }
81 }
82 return DEFAULT;
83 }
84 }