org.graylog2.rest.models.roles.responses.$AutoValue_RoleResponse Maven / Gradle / Ivy
package org.graylog2.rest.models.roles.responses;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Generated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_RoleResponse extends RoleResponse {
private final @NotBlank String name;
private final Optional description;
private final @NotNull Set permissions;
private final boolean readOnly;
$AutoValue_RoleResponse(
@NotBlank String name,
Optional description,
@NotNull Set permissions,
boolean readOnly) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
if (permissions == null) {
throw new NullPointerException("Null permissions");
}
this.permissions = permissions;
this.readOnly = readOnly;
}
@JsonProperty
@Override
public @NotBlank String name() {
return name;
}
@JsonProperty
@Override
public Optional description() {
return description;
}
@JsonProperty
@Override
public @NotNull Set permissions() {
return permissions;
}
@JsonProperty
@Override
public boolean readOnly() {
return readOnly;
}
@Override
public String toString() {
return "RoleResponse{"
+ "name=" + name + ", "
+ "description=" + description + ", "
+ "permissions=" + permissions + ", "
+ "readOnly=" + readOnly
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof RoleResponse) {
RoleResponse that = (RoleResponse) o;
return this.name.equals(that.name())
&& this.description.equals(that.description())
&& this.permissions.equals(that.permissions())
&& this.readOnly == that.readOnly();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= description.hashCode();
h$ *= 1000003;
h$ ^= permissions.hashCode();
h$ *= 1000003;
h$ ^= readOnly ? 1231 : 1237;
return h$;
}
}