From 1525fe9a41ec60c1bc108e107717a66bfc456d1a Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Thu, 3 Jun 2021 23:51:10 +0200 Subject: [PATCH] refactor: generated toString for requests --- .../gamelibrary/requests/CharacterRequest.java | 13 +++++++++++++ .../marvelous/gamelibrary/requests/GameRequest.java | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/CharacterRequest.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/CharacterRequest.java index 28a9690..26fb40a 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/CharacterRequest.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/CharacterRequest.java @@ -36,4 +36,17 @@ public class CharacterRequest extends Request { public int hashCode() { return Objects.hash(super.hashCode(), originEntity, targetEntity, originField, targetField, value, stoneType); } + + @Override + public String toString() { + return "CharacterRequest{" + + "originEntity=" + originEntity + + ", targetEntity=" + targetEntity + + ", originField=" + originField + + ", targetField=" + targetField + + ", value=" + value + + ", stoneType=" + stoneType + + ", type=" + type + + '}'; + } } diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/GameRequest.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/GameRequest.java index 699a6a4..6dcae92 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/GameRequest.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/GameRequest.java @@ -8,4 +8,11 @@ import uulm.teamname.marvelous.gamelibrary.json.ingame.serialize.RequestSerializ /** Represents a game request for: {@link RequestType#DisconnectRequest}. */ @JsonDeserialize(using = RequestDeserializer.class) @JsonSerialize(using = RequestSerializer.class) -public class GameRequest extends Request {} +public class GameRequest extends Request { + @Override + public String toString() { + return "GameRequest{" + + "type=" + type + + '}'; + } +}