From 931d6efaef9bca71d368da8a4204c9cab289c6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 20 Dec 2022 23:07:01 +0100 Subject: [PATCH] Convert message response to immutable record --- .../hidekobot/objects/MessageResponse.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/objects/MessageResponse.java b/src/main/java/wtf/beatrice/hidekobot/objects/MessageResponse.java index 9188cd9..4a590c1 100644 --- a/src/main/java/wtf/beatrice/hidekobot/objects/MessageResponse.java +++ b/src/main/java/wtf/beatrice/hidekobot/objects/MessageResponse.java @@ -3,26 +3,15 @@ package wtf.beatrice.hidekobot.objects; import net.dv8tion.jda.api.entities.MessageEmbed; import org.jetbrains.annotations.Nullable; -public class MessageResponse -{ - private final String content; - private final MessageEmbed embed; - - public MessageResponse(String content, MessageEmbed embed) - { - this.content = content; - this.embed = embed; - } +public record MessageResponse(String content, MessageEmbed embed) { @Nullable - public String getContent() - { + public String getContent() { return content; } @Nullable - public MessageEmbed getEmbed() - { + public MessageEmbed getEmbed() { return embed; } }