-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMessage.java
More file actions
56 lines (41 loc) · 1.23 KB
/
Message.java
File metadata and controls
56 lines (41 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.parse.example;
import com.parse.ParseClassName;
import com.parse.ParseObject;
import com.parse.ParseUser;
@ParseClassName("Message")
public class Message extends ParseObject {
private final String PARSE_USER_KEY = "parseUser";
private final String AUTHOR_KEY = "author";
private final String MESSAGE_KEY = "message";
private final String ROOM_KEY = "room";
public Message() {
}
public ParseUser getParseUser() {
return getParseUser(PARSE_USER_KEY);
}
public void setParseUser(ParseUser parseUser) {
put(PARSE_USER_KEY, parseUser);
}
public String getAuthorName() {
return getString(AUTHOR_KEY);
}
public void setAuthorName(String authorName) {
put(AUTHOR_KEY, authorName);
}
public String getMessage() {
return getString(MESSAGE_KEY);
}
public void setMessage(String message) {
put(MESSAGE_KEY, message);
}
public Room getRoom() {
return (Room) get(ROOM_KEY);
}
public void setRoom(Room room) {
put(ROOM_KEY, room);
}
@Override
public String toString() {
return String.format("objectId=%s: message=%s room=%s", getObjectId(), getMessage(), getRoom());
}
}