01: package org.claros.intouch.webmail.models;
02:
03: import org.claros.intouch.common.utility.Constants;
04:
05: /**
06: * @author Umut Gokbayrak
07: */
08: public class MsgRuleWrapper extends MsgRule {
09: private String destinationName = null;
10: private String actionName = null;
11: private String conditionName = null;
12: private String portionName = null;
13:
14: /**
15: * @param tmp
16: */
17: public MsgRuleWrapper(MsgRule tmp) {
18: setRuleAction(tmp.getRuleAction());
19: setRuleCondition(tmp.getRuleCondition());
20: setDestination(tmp.getDestination());
21: setId(tmp.getId());
22: setKeyword(tmp.getKeyword());
23: setPortion(tmp.getPortion());
24: setUsername(tmp.getUsername());
25:
26: if (tmp.getRuleAction().equals(Constants.ACTION_DELETE)) {
27: setActionName(Constants.ACTION_DELETE_STR);
28: } else if (tmp.getRuleAction().equals(Constants.ACTION_MOVE)) {
29: setActionName(Constants.ACTION_MOVE_STR);
30: }
31:
32: if (tmp.getRuleCondition().equals(Constants.CONDITION_CONTAINS)) {
33: setConditionName(Constants.CONDITION_CONTAINS_STR);
34: } else if (tmp.getRuleCondition().equals(
35: Constants.CONDITION_EQUALS)) {
36: setConditionName(Constants.CONDITION_EQUALS_STR);
37: } else if (tmp.getRuleCondition().equals(
38: Constants.CONDITION_NOT_CONTAINS)) {
39: setConditionName(Constants.CONDITION_NOT_CONTAINS_STR);
40: }
41:
42: if (tmp.getPortion().equals(Constants.PORTION_CC)) {
43: setPortionName(Constants.PORTION_CC_STR);
44: } else if (tmp.getPortion().equals(Constants.PORTION_FROM)) {
45: setPortionName(Constants.PORTION_FROM_STR);
46: } else if (tmp.getPortion().equals(
47: Constants.PORTION_MESSAGE_BODY)) {
48: setPortionName(Constants.PORTION_MESSAGE_BODY_STR);
49: } else if (tmp.getPortion().equals(Constants.PORTION_SUBJECT)) {
50: setPortionName(Constants.PORTION_SUBJECT_STR);
51: } else if (tmp.getPortion().equals(Constants.PORTION_TO)) {
52: setPortionName(Constants.PORTION_TO_STR);
53: }
54: }
55:
56: public String getActionName() {
57: return actionName;
58: }
59:
60: public void setActionName(String actionName) {
61: this .actionName = actionName;
62: }
63:
64: public String getConditionName() {
65: return conditionName;
66: }
67:
68: public void setConditionName(String conditionName) {
69: this .conditionName = conditionName;
70: }
71:
72: public String getDestinationName() {
73: return destinationName;
74: }
75:
76: public void setDestinationName(String destinationName) {
77: this .destinationName = destinationName;
78: }
79:
80: public String getPortionName() {
81: return portionName;
82: }
83:
84: public void setPortionName(String portionName) {
85: this.portionName = portionName;
86: }
87:
88: }
|