-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessage.java
More file actions
37 lines (32 loc) · 868 Bytes
/
Message.java
File metadata and controls
37 lines (32 loc) · 868 Bytes
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
package examples;
import org.ugp.serialx.SerializationDebugger;
import org.ugp.serialx.protocols.SelfSerializable;
/**
* Example of self-serializable object!
* SelfSerializable objects can be serialized directly without necessity of having any {@link SerializationDebugger}, all you need to do is implement {@link SelfSerializable} interface and override {@link SelfSerializable#serialize()} method accordingly!
*
* @author PETO
*
* @see SelfSerializable
*
* @since 1.3.2
*/
public class Message implements SelfSerializable
{
public String str;
public int date;
public Message(String str, int date)
{
this.str = str;
this.date = date;
}
@Override
public String toString() {
return "Message["+str+", "+date+"]";
}
@Override
public Object[] serialize()
{
return new Object[] {str, date};
}
}