Source code: com/obs/common/accounting/objects/JournalLineType.java
1 package com.obs.common.accounting.objects;
2 import java.util.Map;
3 import java.util.HashMap;
4
5 /**
6 *I am not sure if this Class is all that neccesary
7 *But it is better for cohesion
8 */
9 public class JournalLineType implements java.io.Serializable {
10
11 public static boolean DEBIT = true,
12 CREDIT = false;
13
14 protected boolean jLineType;
15
16 public JournalLineType() {
17 this(true);
18 }
19
20 public JournalLineType(boolean lineType) {
21 this.jLineType = lineType;
22 }
23
24 public JournalLineType(Boolean bool){
25 this(bool.booleanValue());
26 }
27 public JournalLineType(String boolValue) {
28 this(new Boolean(boolValue).booleanValue());
29 }
30
31 public boolean booleanValue() { return this.jLineType; }
32
33 public String getLineTypeName() {
34 if(isDebit()) return "DEBIT";
35 return "CREDIT";
36 }
37
38 public Map getJournalLineTypes() {
39 Map map = new HashMap();
40 map.put("true","DEBIT");
41 map.put("false","CREDIT");
42 return map;
43 }
44 public boolean isDebit() { return (jLineType == DEBIT); }
45 public boolean isCredit() { return (jLineType == CREDIT); }
46
47 public boolean equals(JournalLineType lineType) {
48 if(lineType == null) return false;
49 return (jLineType == lineType.booleanValue());
50 }
51 public boolean equals(boolean lineType) {
52 return (jLineType == lineType);
53 }
54 }