com.google.gerrit.entities.$AutoValue_AccessSection Maven / Gradle / Ivy
The newest version!
package com.google.gerrit.entities;
import com.google.common.collect.ImmutableList;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_AccessSection extends AccessSection {
private final String name;
private final ImmutableList permissions;
$AutoValue_AccessSection(
String name,
ImmutableList permissions) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
if (permissions == null) {
throw new NullPointerException("Null permissions");
}
this.permissions = permissions;
}
@Override
public String getName() {
return name;
}
@Override
public ImmutableList getPermissions() {
return permissions;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof AccessSection) {
AccessSection that = (AccessSection) o;
return this.name.equals(that.getName())
&& this.permissions.equals(that.getPermissions());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= permissions.hashCode();
return h$;
}
@Override
protected AccessSection.Builder autoToBuilder() {
return new Builder(this);
}
static class Builder extends AccessSection.Builder {
private String name;
private ImmutableList permissions;
Builder() {
}
private Builder(AccessSection source) {
this.name = source.getName();
this.permissions = source.getPermissions();
}
@Override
public AccessSection.Builder setName(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public String getName() {
if (this.name == null) {
throw new IllegalStateException("Property \"name\" has not been set");
}
return name;
}
@Override
AccessSection.Builder setPermissions(ImmutableList permissions) {
if (permissions == null) {
throw new NullPointerException("Null permissions");
}
this.permissions = permissions;
return this;
}
@Override
protected ImmutableList getPermissions() {
if (this.permissions == null) {
throw new IllegalStateException("Property \"permissions\" has not been set");
}
return permissions;
}
@Override
protected AccessSection autoBuild() {
if (this.name == null
|| this.permissions == null) {
StringBuilder missing = new StringBuilder();
if (this.name == null) {
missing.append(" name");
}
if (this.permissions == null) {
missing.append(" permissions");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_AccessSection(
this.name,
this.permissions);
}
}
}