org.graylog.events.notifications.types.AutoValue_EmailEventNotificationConfig Maven / Gradle / Ivy
package org.graylog.events.notifications.types;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Set;
import javax.annotation.Generated;
import javax.validation.constraints.NotBlank;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_EmailEventNotificationConfig extends EmailEventNotificationConfig {
private final String type;
private final String sender;
private final @NotBlank String subject;
private final String bodyTemplate;
private final String htmlBodyTemplate;
private final Set emailRecipients;
private final Set userRecipients;
private AutoValue_EmailEventNotificationConfig(
String type,
String sender,
@NotBlank String subject,
String bodyTemplate,
String htmlBodyTemplate,
Set emailRecipients,
Set userRecipients) {
this.type = type;
this.sender = sender;
this.subject = subject;
this.bodyTemplate = bodyTemplate;
this.htmlBodyTemplate = htmlBodyTemplate;
this.emailRecipients = emailRecipients;
this.userRecipients = userRecipients;
}
@JsonProperty("type")
@Override
public String type() {
return type;
}
@JsonProperty("sender")
@Override
public String sender() {
return sender;
}
@JsonProperty("subject")
@Override
public @NotBlank String subject() {
return subject;
}
@JsonProperty("body_template")
@Override
public String bodyTemplate() {
return bodyTemplate;
}
@JsonProperty("html_body_template")
@Override
public String htmlBodyTemplate() {
return htmlBodyTemplate;
}
@JsonProperty("email_recipients")
@Override
public Set emailRecipients() {
return emailRecipients;
}
@JsonProperty("user_recipients")
@Override
public Set userRecipients() {
return userRecipients;
}
@Override
public String toString() {
return "EmailEventNotificationConfig{"
+ "type=" + type + ", "
+ "sender=" + sender + ", "
+ "subject=" + subject + ", "
+ "bodyTemplate=" + bodyTemplate + ", "
+ "htmlBodyTemplate=" + htmlBodyTemplate + ", "
+ "emailRecipients=" + emailRecipients + ", "
+ "userRecipients=" + userRecipients
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof EmailEventNotificationConfig) {
EmailEventNotificationConfig that = (EmailEventNotificationConfig) o;
return this.type.equals(that.type())
&& this.sender.equals(that.sender())
&& this.subject.equals(that.subject())
&& this.bodyTemplate.equals(that.bodyTemplate())
&& this.htmlBodyTemplate.equals(that.htmlBodyTemplate())
&& this.emailRecipients.equals(that.emailRecipients())
&& this.userRecipients.equals(that.userRecipients());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= sender.hashCode();
h$ *= 1000003;
h$ ^= subject.hashCode();
h$ *= 1000003;
h$ ^= bodyTemplate.hashCode();
h$ *= 1000003;
h$ ^= htmlBodyTemplate.hashCode();
h$ *= 1000003;
h$ ^= emailRecipients.hashCode();
h$ *= 1000003;
h$ ^= userRecipients.hashCode();
return h$;
}
static final class Builder extends EmailEventNotificationConfig.Builder {
private String type;
private String sender;
private @NotBlank String subject;
private String bodyTemplate;
private String htmlBodyTemplate;
private Set emailRecipients;
private Set userRecipients;
Builder() {
}
@Override
public EmailEventNotificationConfig.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public EmailEventNotificationConfig.Builder sender(String sender) {
if (sender == null) {
throw new NullPointerException("Null sender");
}
this.sender = sender;
return this;
}
@Override
public EmailEventNotificationConfig.Builder subject(String subject) {
if (subject == null) {
throw new NullPointerException("Null subject");
}
this.subject = subject;
return this;
}
@Override
public EmailEventNotificationConfig.Builder bodyTemplate(String bodyTemplate) {
if (bodyTemplate == null) {
throw new NullPointerException("Null bodyTemplate");
}
this.bodyTemplate = bodyTemplate;
return this;
}
@Override
public EmailEventNotificationConfig.Builder htmlBodyTemplate(String htmlBodyTemplate) {
if (htmlBodyTemplate == null) {
throw new NullPointerException("Null htmlBodyTemplate");
}
this.htmlBodyTemplate = htmlBodyTemplate;
return this;
}
@Override
public EmailEventNotificationConfig.Builder emailRecipients(Set emailRecipients) {
if (emailRecipients == null) {
throw new NullPointerException("Null emailRecipients");
}
this.emailRecipients = emailRecipients;
return this;
}
@Override
public EmailEventNotificationConfig.Builder userRecipients(Set userRecipients) {
if (userRecipients == null) {
throw new NullPointerException("Null userRecipients");
}
this.userRecipients = userRecipients;
return this;
}
@Override
public EmailEventNotificationConfig build() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.sender == null) {
missing += " sender";
}
if (this.subject == null) {
missing += " subject";
}
if (this.bodyTemplate == null) {
missing += " bodyTemplate";
}
if (this.htmlBodyTemplate == null) {
missing += " htmlBodyTemplate";
}
if (this.emailRecipients == null) {
missing += " emailRecipients";
}
if (this.userRecipients == null) {
missing += " userRecipients";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_EmailEventNotificationConfig(
this.type,
this.sender,
this.subject,
this.bodyTemplate,
this.htmlBodyTemplate,
this.emailRecipients,
this.userRecipients);
}
}
}