org.graylog2.security.headerauth.AutoValue_HTTPHeaderAuthConfig Maven / Gradle / Ivy
package org.graylog2.security.headerauth;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_HTTPHeaderAuthConfig extends HTTPHeaderAuthConfig {
private final boolean enabled;
private final @NotBlank String usernameHeader;
private AutoValue_HTTPHeaderAuthConfig(
boolean enabled,
@NotBlank String usernameHeader) {
this.enabled = enabled;
this.usernameHeader = usernameHeader;
}
@JsonProperty("enabled")
@Override
public boolean enabled() {
return enabled;
}
@JsonProperty("username_header")
@Override
public @NotBlank String usernameHeader() {
return usernameHeader;
}
@Override
public String toString() {
return "HTTPHeaderAuthConfig{"
+ "enabled=" + enabled + ", "
+ "usernameHeader=" + usernameHeader
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof HTTPHeaderAuthConfig) {
HTTPHeaderAuthConfig that = (HTTPHeaderAuthConfig) o;
return this.enabled == that.enabled()
&& this.usernameHeader.equals(that.usernameHeader());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= enabled ? 1231 : 1237;
h$ *= 1000003;
h$ ^= usernameHeader.hashCode();
return h$;
}
static final class Builder extends HTTPHeaderAuthConfig.Builder {
private boolean enabled;
private @NotBlank String usernameHeader;
private byte set$0;
Builder() {
}
@Override
public HTTPHeaderAuthConfig.Builder enabled(boolean enabled) {
this.enabled = enabled;
set$0 |= (byte) 1;
return this;
}
@Override
public HTTPHeaderAuthConfig.Builder usernameHeader(String usernameHeader) {
if (usernameHeader == null) {
throw new NullPointerException("Null usernameHeader");
}
this.usernameHeader = usernameHeader;
return this;
}
@Override
public HTTPHeaderAuthConfig build() {
if (set$0 != 1
|| this.usernameHeader == null) {
StringBuilder missing = new StringBuilder();
if ((set$0 & 1) == 0) {
missing.append(" enabled");
}
if (this.usernameHeader == null) {
missing.append(" usernameHeader");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_HTTPHeaderAuthConfig(
this.enabled,
this.usernameHeader);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy