org.graylog2.shared.rest.resources.AutoValue_ProxiedResource_MasterResponse Maven / Gradle / Ivy
package org.graylog2.shared.rest.resources;
import java.util.Optional;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ProxiedResource_MasterResponse extends ProxiedResource.MasterResponse {
private final boolean isSuccess;
private final int code;
private final Optional entity;
private final Optional error;
AutoValue_ProxiedResource_MasterResponse(
boolean isSuccess,
int code,
Optional entity,
Optional error) {
this.isSuccess = isSuccess;
this.code = code;
if (entity == null) {
throw new NullPointerException("Null entity");
}
this.entity = entity;
if (error == null) {
throw new NullPointerException("Null error");
}
this.error = error;
}
@Override
public boolean isSuccess() {
return isSuccess;
}
@Override
public int code() {
return code;
}
@Override
public Optional entity() {
return entity;
}
@Override
public Optional error() {
return error;
}
@Override
public String toString() {
return "MasterResponse{"
+ "isSuccess=" + isSuccess + ", "
+ "code=" + code + ", "
+ "entity=" + entity + ", "
+ "error=" + error
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ProxiedResource.MasterResponse) {
ProxiedResource.MasterResponse that = (ProxiedResource.MasterResponse) o;
return this.isSuccess == that.isSuccess()
&& this.code == that.code()
&& this.entity.equals(that.entity())
&& this.error.equals(that.error());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= isSuccess ? 1231 : 1237;
h$ *= 1000003;
h$ ^= code;
h$ *= 1000003;
h$ ^= entity.hashCode();
h$ *= 1000003;
h$ ^= error.hashCode();
return h$;
}
}