aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/model/CommandResult.java
blob: c310756c3035c406e573fe7887a5a785002b6ccf (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.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<Message> 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;
    }

}