litesoft
Diff Revisions
949
vs
950
for /trunk/Java/core/Anywhere/src/org/litesoft/bo/attributes/Case.java
|
@@ -1,47 +1,47 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.bo.attributes; |
3 |
|
- |
|
4 |
|
- |
public class Case implements PropertyOfAMD { |
5 |
|
- |
public enum Form { |
6 |
|
- |
AsEntered, Ignored, Uppered, Lowered |
7 |
|
- |
} |
8 |
|
- |
|
9 |
|
- |
public static final Case Ignored = new Case( Form.Ignored ); |
10 |
|
- |
public static final Case Uppered = new Case( Form.Uppered ); |
11 |
|
- |
public static final Case Lowered = new Case( Form.Lowered ); |
12 |
|
- |
|
13 |
|
- |
public static Form get( AttributeMetaData pAMD ) { |
14 |
|
- |
PropertyOfAMD zProperty = pAMD.getProperties().get( MAP_KEY ); |
15 |
|
- |
if ( zProperty != null ) { |
16 |
|
- |
return ((Case) zProperty).mValue; |
17 |
|
- |
} |
18 |
|
- |
return Form.AsEntered; |
19 |
|
- |
} |
20 |
|
- |
|
21 |
|
- |
private static final String MAP_KEY = "Case"; |
22 |
|
- |
|
23 |
|
- |
private Case( Form pValue ) { |
24 |
|
- |
mValue = pValue; |
25 |
|
- |
} |
26 |
|
- |
|
27 |
|
- |
private Form mValue; |
28 |
|
- |
|
29 |
|
- |
@Override |
30 |
|
- |
public String toString() { |
31 |
|
- |
return MAP_KEY + "." + mValue; |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
public String getMapKey() { |
35 |
|
- |
return MAP_KEY; |
36 |
|
- |
} |
37 |
|
- |
|
38 |
|
- |
@Override |
39 |
|
- |
public boolean equals( Object them ) { |
40 |
|
- |
return (this == them) || ((them != null) && (this.getClass() == them.getClass()) && (this.mValue == ((Case) them).mValue)); |
41 |
|
- |
} |
42 |
|
- |
|
43 |
|
- |
@Override |
44 |
|
- |
public int hashCode() { |
45 |
|
- |
return mValue.hashCode(); |
46 |
|
- |
} |
47 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.bo.attributes; |
|
3 |
+ |
|
|
4 |
+ |
public class Case implements PropertyOfAMD { |
|
5 |
+ |
public enum Form { |
|
6 |
+ |
AsEntered, Ignored, Uppered, Lowered |
|
7 |
+ |
} |
|
8 |
+ |
|
|
9 |
+ |
public static final Case Ignored = new Case( Form.Ignored ); |
|
10 |
+ |
public static final Case Uppered = new Case( Form.Uppered ); |
|
11 |
+ |
public static final Case Lowered = new Case( Form.Lowered ); |
|
12 |
+ |
|
|
13 |
+ |
public static Form get( AttributeMetaData pAMD ) { |
|
14 |
+ |
PropertyOfAMD zProperty = pAMD.getProperties().get( MAP_KEY ); |
|
15 |
+ |
if ( zProperty != null ) { |
|
16 |
+ |
return ((Case) zProperty).mValue; |
|
17 |
+ |
} |
|
18 |
+ |
return Form.AsEntered; |
|
19 |
+ |
} |
|
20 |
+ |
|
|
21 |
+ |
private static final String MAP_KEY = "Case"; |
|
22 |
+ |
|
|
23 |
+ |
private Case( Form pValue ) { |
|
24 |
+ |
mValue = pValue; |
|
25 |
+ |
} |
|
26 |
+ |
|
|
27 |
+ |
private Form mValue; |
|
28 |
+ |
|
|
29 |
+ |
@Override |
|
30 |
+ |
public String toString() { |
|
31 |
+ |
return MAP_KEY + "." + mValue; |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
public String getMapKey() { |
|
35 |
+ |
return MAP_KEY; |
|
36 |
+ |
} |
|
37 |
+ |
|
|
38 |
+ |
@Override |
|
39 |
+ |
public boolean equals( Object them ) { |
|
40 |
+ |
return (this == them) || ((them != null) && (this.getClass() == them.getClass()) && (this.mValue == ((Case) them).mValue)); |
|
41 |
+ |
} |
|
42 |
+ |
|
|
43 |
+ |
@Override |
|
44 |
+ |
public int hashCode() { |
|
45 |
+ |
return mValue.hashCode(); |
|
46 |
+ |
} |
|
47 |
+ |
} |