fix: fixed non-empty String validation to be non-empty

This commit is contained in:
Yannik Bretschneider 2021-06-05 16:47:05 +02:00
parent 72ab0164b3
commit 871c380952
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.messages; package uulm.teamname.marvelous.gamelibrary.messages;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
public class ErrorMessage extends BasicMessage{ public class ErrorMessage extends BasicMessage{

View File

@ -1,5 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.messages.client; package uulm.teamname.marvelous.gamelibrary.messages.client;
import jakarta.validation.constraints.NotEmpty;
import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage; import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage;
import uulm.teamname.marvelous.gamelibrary.messages.MessageType; import uulm.teamname.marvelous.gamelibrary.messages.MessageType;
@ -10,10 +11,10 @@ public class HelloServerMessage extends BasicMessage {
public final MessageType messageType = MessageType.HELLO_SERVER; public final MessageType messageType = MessageType.HELLO_SERVER;
/** User-chosen name, basically a PlayerName */ /** User-chosen name, basically a PlayerName */
@NotNull @NotEmpty
public String name; public String name;
/** Device ID sent by the Client, might be anything, but used together with name to uniquely identify the client */ /** Device ID sent by the Client, might be anything, but used together with name to uniquely identify the client */
@NotNull @NotEmpty
public String deviceID; public String deviceID;
} }

View File

@ -1,5 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.messages.server; package uulm.teamname.marvelous.gamelibrary.messages.server;
import jakarta.validation.constraints.NotEmpty;
import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage; import uulm.teamname.marvelous.gamelibrary.messages.BasicMessage;
import uulm.teamname.marvelous.gamelibrary.messages.MessageType; import uulm.teamname.marvelous.gamelibrary.messages.MessageType;
@ -10,6 +11,6 @@ public class GoodbyeClientMessage extends BasicMessage {
public final MessageType messageType = MessageType.GOODBYE_CLIENT; public final MessageType messageType = MessageType.GOODBYE_CLIENT;
/** A message sent to the client on disconnect */ /** A message sent to the client on disconnect */
@NotNull @NotEmpty
public String message = "You got disconnected."; public String message = "You got disconnected.";
} }