aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/server/helpers/CommandResult.java
blob: a772153b4f506a789bf75024bb9a55c492b24d03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.juick.server.helpers;

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<Message> getNewMessage() {
        return Optional.of(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;
    }

}