org.graylog.security.events.AutoValue_EntitySharesUpdateEvent Maven / Gradle / Ivy
package org.graylog.security.events;
import com.google.common.collect.ImmutableList;
import java.util.List;
import javax.annotation.processing.Generated;
import org.graylog.grn.GRN;
import org.graylog2.plugin.database.users.User;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_EntitySharesUpdateEvent extends EntitySharesUpdateEvent {
private final User user;
private final GRN entity;
private final ImmutableList creates;
private final ImmutableList deletes;
private final ImmutableList updates;
private AutoValue_EntitySharesUpdateEvent(
User user,
GRN entity,
ImmutableList creates,
ImmutableList deletes,
ImmutableList updates) {
this.user = user;
this.entity = entity;
this.creates = creates;
this.deletes = deletes;
this.updates = updates;
}
@Override
public User user() {
return user;
}
@Override
public GRN entity() {
return entity;
}
@Override
public ImmutableList creates() {
return creates;
}
@Override
public ImmutableList deletes() {
return deletes;
}
@Override
public ImmutableList updates() {
return updates;
}
@Override
public String toString() {
return "EntitySharesUpdateEvent{"
+ "user=" + user + ", "
+ "entity=" + entity + ", "
+ "creates=" + creates + ", "
+ "deletes=" + deletes + ", "
+ "updates=" + updates
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof EntitySharesUpdateEvent) {
EntitySharesUpdateEvent that = (EntitySharesUpdateEvent) o;
return this.user.equals(that.user())
&& this.entity.equals(that.entity())
&& this.creates.equals(that.creates())
&& this.deletes.equals(that.deletes())
&& this.updates.equals(that.updates());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= user.hashCode();
h$ *= 1000003;
h$ ^= entity.hashCode();
h$ *= 1000003;
h$ ^= creates.hashCode();
h$ *= 1000003;
h$ ^= deletes.hashCode();
h$ *= 1000003;
h$ ^= updates.hashCode();
return h$;
}
static final class Builder extends EntitySharesUpdateEvent.Builder {
private User user;
private GRN entity;
private ImmutableList.Builder createsBuilder$;
private ImmutableList creates;
private ImmutableList.Builder deletesBuilder$;
private ImmutableList deletes;
private ImmutableList.Builder updatesBuilder$;
private ImmutableList updates;
Builder() {
}
@Override
public EntitySharesUpdateEvent.Builder user(User user) {
if (user == null) {
throw new NullPointerException("Null user");
}
this.user = user;
return this;
}
@Override
public EntitySharesUpdateEvent.Builder entity(GRN entity) {
if (entity == null) {
throw new NullPointerException("Null entity");
}
this.entity = entity;
return this;
}
@Override
public EntitySharesUpdateEvent.Builder creates(List creates) {
if (createsBuilder$ != null) {
throw new IllegalStateException("Cannot set creates after calling createsBuilder()");
}
this.creates = ImmutableList.copyOf(creates);
return this;
}
@Override
public ImmutableList.Builder createsBuilder() {
if (createsBuilder$ == null) {
if (creates == null) {
createsBuilder$ = ImmutableList.builder();
} else {
createsBuilder$ = ImmutableList.builder();
createsBuilder$.addAll(creates);
creates = null;
}
}
return createsBuilder$;
}
@Override
public EntitySharesUpdateEvent.Builder deletes(List deletes) {
if (deletesBuilder$ != null) {
throw new IllegalStateException("Cannot set deletes after calling deletesBuilder()");
}
this.deletes = ImmutableList.copyOf(deletes);
return this;
}
@Override
public ImmutableList.Builder deletesBuilder() {
if (deletesBuilder$ == null) {
if (deletes == null) {
deletesBuilder$ = ImmutableList.builder();
} else {
deletesBuilder$ = ImmutableList.builder();
deletesBuilder$.addAll(deletes);
deletes = null;
}
}
return deletesBuilder$;
}
@Override
public EntitySharesUpdateEvent.Builder updates(List updates) {
if (updatesBuilder$ != null) {
throw new IllegalStateException("Cannot set updates after calling updatesBuilder()");
}
this.updates = ImmutableList.copyOf(updates);
return this;
}
@Override
public ImmutableList.Builder updatesBuilder() {
if (updatesBuilder$ == null) {
if (updates == null) {
updatesBuilder$ = ImmutableList.builder();
} else {
updatesBuilder$ = ImmutableList.builder();
updatesBuilder$.addAll(updates);
updates = null;
}
}
return updatesBuilder$;
}
@Override
public EntitySharesUpdateEvent build() {
if (createsBuilder$ != null) {
this.creates = createsBuilder$.build();
} else if (this.creates == null) {
this.creates = ImmutableList.of();
}
if (deletesBuilder$ != null) {
this.deletes = deletesBuilder$.build();
} else if (this.deletes == null) {
this.deletes = ImmutableList.of();
}
if (updatesBuilder$ != null) {
this.updates = updatesBuilder$.build();
} else if (this.updates == null) {
this.updates = ImmutableList.of();
}
if (this.user == null
|| this.entity == null) {
StringBuilder missing = new StringBuilder();
if (this.user == null) {
missing.append(" user");
}
if (this.entity == null) {
missing.append(" entity");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_EntitySharesUpdateEvent(
this.user,
this.entity,
this.creates,
this.deletes,
this.updates);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy