org.graylog.plugins.views.search.AutoValue_Search Maven / Gradle / Ivy
package org.graylog.plugins.views.search;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableSet;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.graylog.plugins.views.search.views.PluginMetadataSummary;
import org.joda.time.DateTime;
import org.mongojack.Id;
import org.mongojack.ObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Search extends Search {
@Nullable
private final String id;
private final ImmutableSet queries;
private final ImmutableSet parameters;
private final Map requires;
private final Optional owner;
private final DateTime createdAt;
private AutoValue_Search(
@Nullable String id,
ImmutableSet queries,
ImmutableSet parameters,
Map requires,
Optional owner,
DateTime createdAt) {
this.id = id;
this.queries = queries;
this.parameters = parameters;
this.requires = requires;
this.owner = owner;
this.createdAt = createdAt;
}
@JsonProperty
@Nullable
@Id
@ObjectId
@Override
public String id() {
return id;
}
@JsonProperty
@Override
public ImmutableSet queries() {
return queries;
}
@JsonProperty
@Override
public ImmutableSet parameters() {
return parameters;
}
@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 "Search{"
+ "id=" + id + ", "
+ "queries=" + queries + ", "
+ "parameters=" + parameters + ", "
+ "requires=" + requires + ", "
+ "owner=" + owner + ", "
+ "createdAt=" + createdAt
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Search) {
Search that = (Search) o;
return (this.id == null ? that.id() == null : this.id.equals(that.id()))
&& this.queries.equals(that.queries())
&& this.parameters.equals(that.parameters())
&& 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$ ^= queries.hashCode();
h$ *= 1000003;
h$ ^= parameters.hashCode();
h$ *= 1000003;
h$ ^= requires.hashCode();
h$ *= 1000003;
h$ ^= owner.hashCode();
h$ *= 1000003;
h$ ^= createdAt.hashCode();
return h$;
}
@Override
public Search.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends Search.Builder {
private String id;
private ImmutableSet queries;
private ImmutableSet parameters;
private Map requires;
private Optional owner = Optional.empty();
private DateTime createdAt;
Builder() {
}
private Builder(Search source) {
this.id = source.id();
this.queries = source.queries();
this.parameters = source.parameters();
this.requires = source.requires();
this.owner = source.owner();
this.createdAt = source.createdAt();
}
@Override
public Search.Builder id(String id) {
this.id = id;
return this;
}
@Override
@Nullable public String id() {
return id;
}
@Override
public Search.Builder queries(ImmutableSet queries) {
if (queries == null) {
throw new NullPointerException("Null queries");
}
this.queries = queries;
return this;
}
@Override
public Search.Builder parameters(ImmutableSet parameters) {
if (parameters == null) {
throw new NullPointerException("Null parameters");
}
this.parameters = parameters;
return this;
}
@Override
public Search.Builder requires(Map requires) {
if (requires == null) {
throw new NullPointerException("Null requires");
}
this.requires = requires;
return this;
}
@Override
public Search.Builder owner(@Nullable String owner) {
this.owner = Optional.ofNullable(owner);
return this;
}
@Override
public Search.Builder createdAt(DateTime createdAt) {
if (createdAt == null) {
throw new NullPointerException("Null createdAt");
}
this.createdAt = createdAt;
return this;
}
@Override
Search autoBuild() {
if (this.queries == null
|| this.parameters == null
|| this.requires == null
|| this.createdAt == null) {
StringBuilder missing = new StringBuilder();
if (this.queries == null) {
missing.append(" queries");
}
if (this.parameters == null) {
missing.append(" parameters");
}
if (this.requires == null) {
missing.append(" requires");
}
if (this.createdAt == null) {
missing.append(" createdAt");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_Search(
this.id,
this.queries,
this.parameters,
this.requires,
this.owner,
this.createdAt);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy