9f1ca8456cddd06f2e7ac167a381b3cbaf1bce96
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / engine / Configuration.java
1 package net.pterodactylus.rhynodge.engine;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5
6 import com.fasterxml.jackson.annotation.JsonProperty;
7 import com.fasterxml.jackson.databind.ObjectMapper;
8
9 /**
10  * Stores general configuration of Rhynodge.
11  *
12  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
13  */
14 public class Configuration {
15
16         @JsonProperty
17         private final String smtpHostname = null;
18
19         @JsonProperty
20         private String errorEmailSender = null;
21
22         @JsonProperty
23         private String errorEmailRecipient = null;
24
25         public String getSmtpHostname() {
26                 return smtpHostname;
27         }
28
29         public String getErrorEmailSender() {
30                 return errorEmailSender;
31         }
32
33         public String getErrorEmailRecipient() {
34                 return errorEmailRecipient;
35         }
36
37         public static Configuration from(InputStream inputStream) throws IOException {
38                 return new ObjectMapper().readValue(inputStream, Configuration.class);
39         }
40
41 }