1 package org.apache.maven.model.converter.plugins;
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 public class PropertyUtils
29 {
30 static String convertOnOffToBoolean( String value )
31 {
32 if ( value != null )
33 {
34 if ( "on".equalsIgnoreCase( value ) )
35 {
36 return Boolean.TRUE.toString();
37 }
38 if ( "off".equalsIgnoreCase( value ) )
39 {
40 return Boolean.FALSE.toString();
41 }
42 }
43 return null;
44 }
45
46 static String convertYesNoToBoolean( String value )
47 {
48 if ( value != null )
49 {
50 if ( "yes".equalsIgnoreCase( value ) )
51 {
52 return Boolean.TRUE.toString();
53 }
54 if ( "no".equalsIgnoreCase( value ) )
55 {
56 return Boolean.FALSE.toString();
57 }
58 }
59 return null;
60 }
61
62 static String invertBoolean( String stringValue )
63 {
64 if ( stringValue != null )
65 {
66 boolean booleanValue = Boolean.valueOf( stringValue ).booleanValue();
67 boolean invertedBooleanValue = !booleanValue;
68 return new Boolean( invertedBooleanValue ).toString();
69 }
70 return null;
71 }
72 }