🎨 Replace QC filter with Kotlin version
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / states / OutputState.java
1 package net.pterodactylus.rhynodge.states;
2
3 import java.util.Optional;
4
5 import net.pterodactylus.rhynodge.State;
6
7 import com.fasterxml.jackson.annotation.JsonProperty;
8
9 /**
10  * {@link State} implementation that can expose itself as plain text and/or
11  * HTML.
12  *
13  * @author <a href="mailto:bombe@pterodactylus.net">David â€˜Bombe’ Roden</a>
14  */
15 public class OutputState extends AbstractState {
16
17         private final Optional<String> plainTextOutput;
18         private final Optional<String> htmlOutput;
19
20         public OutputState() {
21                 this(Optional.<String>empty(), Optional.<String>empty());
22         }
23
24         public OutputState(Optional<String> plainTextOutput, Optional<String> htmlOutput) {
25                 this.plainTextOutput = plainTextOutput;
26                 this.htmlOutput = htmlOutput;
27         }
28
29         @Override
30         public boolean isEmpty() {
31                 return !plainTextOutput.isPresent() && !htmlOutput.isPresent();
32         }
33
34         public Optional<String> plainTextOutput() {
35                 return plainTextOutput;
36         }
37
38         public Optional<String> htmlOutput() {
39                 return htmlOutput;
40         }
41
42 }