1 25 26 29 package net.killingar.forum.internal; 30 31 import java.sql.Timestamp ; 32 33 public class Message extends IDItemImpl implements ParentIDItem 34 { 35 public long areaID = -1, parentID = -1, ownerID = -1, noWords; 36 public String subject, body; 37 public Timestamp timecreated, lastChanged; 38 public long lastChangedUserID = -1; 39 public boolean visible; 40 41 FieldData splitBody; 42 43 public Message( 44 long _ID, 45 long _parentID, 46 long _areaID, 47 long _ownerID, 48 Timestamp _timecreated, 49 Timestamp _lastChanged, 50 long _lastChangedUserID, 51 String _subject, 52 String _body, 53 long _noWords, 54 boolean _visible) 55 { 56 super(_ID); 57 parentID = _parentID; 58 areaID = _areaID; 59 ownerID = _ownerID; 60 timecreated = _timecreated; 61 lastChanged = _lastChanged; 62 lastChangedUserID = _lastChangedUserID; 63 subject = _subject; 64 body = _body; 65 noWords = _noWords; 66 visible = _visible; 67 } 68 69 public Message( 70 Message message) 71 { 72 super(message.ID); 73 parentID = message.parentID; 74 areaID = message.areaID; 75 ownerID = message.ownerID; 76 timecreated = message.timecreated; 77 lastChanged = message.lastChanged; 78 lastChangedUserID = message.lastChangedUserID; 79 subject = message.subject; 80 body = message.body; 81 noWords = message.noWords; 82 visible = message.visible; 83 } 84 85 public Message( 86 long _areaID, 87 long _parentID, 88 String _subject, 89 String _body) 90 { 91 super(-1); 92 areaID = _areaID; 93 parentID = _parentID; 94 subject = _subject; 95 body = _body; 96 } 97 98 public Message(long _ID) 99 { 100 super(_ID); 101 } 102 103 public Message() 104 { 105 super(-1); 106 } 107 108 public Message(long _ID, boolean _visible) 109 { 110 super(_ID); 111 112 visible = _visible; 113 } 114 115 public long getAreaID() { return areaID; } 116 public long getParentID() { return parentID; } 117 public long getOwnerID() { return ownerID; } 118 public long getNoWords() { return noWords; } 119 public String getSubject() { return subject; } 120 public String getBody() { return body; } 121 public Timestamp getTimecreated() { return timecreated; } 122 public Timestamp getLastChanged() { return lastChanged; } 123 public long getLastChangedUserID() { return lastChangedUserID; } 124 public boolean getVisible() { return visible; } 125 126 public String toString() { return "{id: "+ID+" subject: '"+subject+"' parentID: "+parentID+" areaID: "+areaID+" ownerID: "+ownerID+"}"; }; 127 128 public FieldData getSplitBody() 129 { 130 if (body == null || "".equals(body)) 131 return null; 132 133 if (splitBody == null) 134 splitBody = new FieldData(body); 135 136 return splitBody; 137 } 138 } | Popular Tags |