Aufräumarbeitenund einige Formatierungen
This commit is contained in:
parent
d7bbfdea2b
commit
040319dcbb
11 changed files with 238 additions and 127 deletions
30
src/utils/Message.java
Normal file
30
src/utils/Message.java
Normal file
|
@ -0,0 +1,30 @@
|
|||
package utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.FormatStyle;
|
||||
|
||||
public class Message implements Serializable {
|
||||
|
||||
String username;
|
||||
String message;
|
||||
//String date = new SimpleDateFormat("dd-MM-yyyy").format(new Date());
|
||||
LocalDateTime current = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM);
|
||||
String date = current.format(formatter);
|
||||
|
||||
public Message(String username, String message) {
|
||||
this.username = username;
|
||||
this.message = message;
|
||||
//this.date = date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "nickname=" + username
|
||||
+ ", message=" + message
|
||||
+ ", time=" + date;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue