01: package org.claros.commons.mail.models;
02:
03: public class EmailSensitivity {
04:
05: public static final short NORMAL = 1;
06: public static final short PERSONAL = 2;
07: public static final short PRIVATE = 3;
08: public static final short CONFIDENTIAL = 4;
09:
10: public static String toStringValue(int val) {
11: switch (val) {
12: case PERSONAL:
13: return "Personal";
14: case PRIVATE:
15: return "Private";
16: case CONFIDENTIAL:
17: return "Company-Confidential";
18: default:
19: return "Normal";
20: }
21: }
22:
23: public static short valueOf(String val) {
24: String value = val.toLowerCase();
25: if (value.equals("personal"))
26: return PERSONAL;
27: else if (value.equals("private"))
28: return PRIVATE;
29: else if (value.indexOf("confidential") > 0)
30: return CONFIDENTIAL;
31: else
32: return NORMAL;
33: }
34: }
|