::
{{<nowiki>
import java.util.Calendar;
import java.util.Date;
import cs.dps914.osgi.lab.chatinterface.IMessage;
public class SimpleMessage implements IMessage {
private String source;
private Date time;
private String message;
public SimpleMessage(String src,String msg) {
setSource(src);
setTime(Calendar.getInstance().getTime());
setMessage(msg);
}
public void setSource(String src) {
if (src!=null) {
source=src;
} else {
source="";
}
}
public String getSource() {
return source;
}
public void setTime(Date time) {
if (time!=null) {
this.time=time;
} else {
this.time=Calendar.getInstance().getTime();
}
}
public Date getTime() {
return time;
}
public void setMessage(String msg) {
if (msg!=null) {
message=msg;
} else {
message="";
}
}
public String getMessage() {
return message;
}
}
</nowiki>
}}