org.graylog.plugins.views.search.views.$AutoValue_ViewSummaryDTO Maven / Gradle / Ivy
package org.graylog.plugins.views.search.views;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableSet;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.validation.constraints.NotBlank;
import org.joda.time.DateTime;
import org.mongojack.Id;
import org.mongojack.ObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_ViewSummaryDTO extends ViewSummaryDTO {
private final String id;
private final ViewDTO.Type type;
private final @NotBlank String title;
private final String summary;
private final String description;
private final String searchId;
private final ImmutableSet properties;
private final Map requires;
private final Optional owner;
private final DateTime createdAt;
$AutoValue_ViewSummaryDTO(
@Nullable String id,
ViewDTO.Type type,
@NotBlank String title,
String summary,
String description,
String searchId,
ImmutableSet properties,
Map requires,
Optional owner,
DateTime createdAt) {
this.id = id;
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
if (title == null) {
throw new NullPointerException("Null title");
}
this.title = title;
if (summary == null) {
throw new NullPointerException("Null summary");
}
this.summary = summary;
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
if (searchId == null) {
throw new NullPointerException("Null searchId");
}
this.searchId = searchId;
if (properties == null) {
throw new NullPointerException("Null properties");
}
this.properties = properties;
if (requires == null) {
throw new NullPointerException("Null requires");
}
this.requires = requires;
if (owner == null) {
throw new NullPointerException("Null owner");
}
this.owner = owner;
if (createdAt == null) {
throw new NullPointerException("Null createdAt");
}
this.createdAt = createdAt;
}
@ObjectId
@Id
@Nullable
@JsonProperty("id")
@Override
public String id() {
return id;
}
@JsonProperty("type")
@Override
public ViewDTO.Type type() {
return type;
}
@JsonProperty("title")
@Override
public @NotBlank String title() {
return title;
}
@JsonProperty("summary")
@Override
public String summary() {
return summary;
}
@JsonProperty("description")
@Override
public String description() {
return description;
}
@JsonProperty("search_id")
@Override
public String searchId() {
return searchId;
}
@JsonProperty("properties")
@Override
public ImmutableSet properties() {
return properties;
}
@JsonProperty("requires")
@Override
public Map requires() {
return requires;
}
@JsonProperty("owner")
@Override
public Optional owner() {
return owner;
}
@JsonProperty("created_at")
@Override
public DateTime createdAt() {
return createdAt;
}
@Override
public String toString() {
return "ViewSummaryDTO{"
+ "id=" + id + ", "
+ "type=" + type + ", "
+ "title=" + title + ", "
+ "summary=" + summary + ", "
+ "description=" + description + ", "
+ "searchId=" + searchId + ", "
+ "properties=" + properties + ", "
+ "requires=" + requires + ", "
+ "owner=" + owner + ", "
+ "createdAt=" + createdAt
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ViewSummaryDTO) {
ViewSummaryDTO that = (ViewSummaryDTO) o;
return (this.id == null ? that.id() == null : this.id.equals(that.id()))
&& this.type.equals(that.type())
&& this.title.equals(that.title())
&& this.summary.equals(that.summary())
&& this.description.equals(that.description())
&& this.searchId.equals(that.searchId())
&& this.properties.equals(that.properties())
&& this.requires.equals(that.requires())
&& this.owner.equals(that.owner())
&& this.createdAt.equals(that.createdAt());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= (id == null) ? 0 : id.hashCode();
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= title.hashCode();
h$ *= 1000003;
h$ ^= summary.hashCode();
h$ *= 1000003;
h$ ^= description.hashCode();
h$ *= 1000003;
h$ ^= searchId.hashCode();
h$ *= 1000003;
h$ ^= properties.hashCode();
h$ *= 1000003;
h$ ^= requires.hashCode();
h$ *= 1000003;
h$ ^= owner.hashCode();
h$ *= 1000003;
h$ ^= createdAt.hashCode();
return h$;
}
@Override
public ViewSummaryDTO.Builder toBuilder() {
return new Builder(this);
}
static class Builder extends ViewSummaryDTO.Builder {
private String id;
private ViewDTO.Type type;
private @NotBlank String title;
private String summary;
private String description;
private String searchId;
private ImmutableSet.Builder propertiesBuilder$;
private ImmutableSet properties;
private Map requires;
private Optional owner = Optional.empty();
private DateTime createdAt;
Builder() {
}
private Builder(ViewSummaryDTO source) {
this.id = source.id();
this.type = source.type();
this.title = source.title();
this.summary = source.summary();
this.description = source.description();
this.searchId = source.searchId();
this.properties = source.properties();
this.requires = source.requires();
this.owner = source.owner();
this.createdAt = source.createdAt();
}
@Override
public ViewSummaryDTO.Builder id(String id) {
this.id = id;
return this;
}
@Override
public ViewSummaryDTO.Builder type(ViewDTO.Type type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public ViewSummaryDTO.Builder title(String title) {
if (title == null) {
throw new NullPointerException("Null title");
}
this.title = title;
return this;
}
@Override
public ViewSummaryDTO.Builder summary(String summary) {
if (summary == null) {
throw new NullPointerException("Null summary");
}
this.summary = summary;
return this;
}
@Override
public ViewSummaryDTO.Builder description(String description) {
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
return this;
}
@Override
public ViewSummaryDTO.Builder searchId(String searchId) {
if (searchId == null) {
throw new NullPointerException("Null searchId");
}
this.searchId = searchId;
return this;
}
@Override
ImmutableSet.Builder propertiesBuilder() {
if (propertiesBuilder$ == null) {
if (properties == null) {
propertiesBuilder$ = ImmutableSet.builder();
} else {
propertiesBuilder$ = ImmutableSet.builder();
propertiesBuilder$.addAll(properties);
properties = null;
}
}
return propertiesBuilder$;
}
@Override
public ViewSummaryDTO.Builder requires(Map requires) {
if (requires == null) {
throw new NullPointerException("Null requires");
}
this.requires = requires;
return this;
}
@Override
public ViewSummaryDTO.Builder owner(@Nullable String owner) {
this.owner = Optional.ofNullable(owner);
return this;
}
@Override
public ViewSummaryDTO.Builder createdAt(DateTime createdAt) {
if (createdAt == null) {
throw new NullPointerException("Null createdAt");
}
this.createdAt = createdAt;
return this;
}
@Override
public ViewSummaryDTO build() {
if (propertiesBuilder$ != null) {
this.properties = propertiesBuilder$.build();
} else if (this.properties == null) {
this.properties = ImmutableSet.of();
}
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.title == null) {
missing += " title";
}
if (this.summary == null) {
missing += " summary";
}
if (this.description == null) {
missing += " description";
}
if (this.searchId == null) {
missing += " searchId";
}
if (this.requires == null) {
missing += " requires";
}
if (this.createdAt == null) {
missing += " createdAt";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ViewSummaryDTO(
this.id,
this.type,
this.title,
this.summary,
this.description,
this.searchId,
this.properties,
this.requires,
this.owner,
this.createdAt);
}
}
}