From ae76024011a8442ae7eab953e0b97e9fe2c7c201 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 25 Sep 2018 11:53:37 +0300 Subject: reorganize layout --- .../main/java/com/juick/model/CommandResult.java | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 juick-common/src/main/java/com/juick/model/CommandResult.java (limited to 'juick-common/src/main/java/com/juick/model/CommandResult.java') diff --git a/juick-common/src/main/java/com/juick/model/CommandResult.java b/juick-common/src/main/java/com/juick/model/CommandResult.java new file mode 100644 index 00000000..c310756c --- /dev/null +++ b/juick-common/src/main/java/com/juick/model/CommandResult.java @@ -0,0 +1,35 @@ +package com.juick.model; + +import com.juick.Message; + +import java.util.Optional; + +public class CommandResult { + private String text; + private String markdown; + private Message newMessage; + + public String getText() { + return text; + } + public String getMarkdown() { + return markdown; + } + + public Optional getNewMessage() { + return Optional.ofNullable(newMessage); + } + public static CommandResult build(Message newMessage, String text, String markdown) { + CommandResult result = new CommandResult(); + result.newMessage = newMessage; + result.text = text; + result.markdown = markdown; + return result; + } + public static CommandResult fromString(String text) { + CommandResult result = new CommandResult(); + result.text = text; + return result; + } + +} -- cgit v1.2.3