com.spotify.docker.client.messages.swarm.AutoValue_ContainerSpec Maven / Gradle / Ivy
package com.spotify.docker.client.messages.swarm;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.spotify.docker.client.messages.mount.Mount;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ContainerSpec extends ContainerSpec {
private final String image;
private final ImmutableMap labels;
private final ImmutableList command;
private final ImmutableList args;
private final ImmutableList env;
private final String dir;
private final String user;
private final ImmutableList groups;
private final Boolean tty;
private final ImmutableList mounts;
private final Long stopGracePeriod;
private AutoValue_ContainerSpec(
String image,
@Nullable ImmutableMap labels,
ImmutableList command,
@Nullable ImmutableList args,
@Nullable ImmutableList env,
@Nullable String dir,
@Nullable String user,
@Nullable ImmutableList groups,
@Nullable Boolean tty,
@Nullable ImmutableList mounts,
@Nullable Long stopGracePeriod) {
this.image = image;
this.labels = labels;
this.command = command;
this.args = args;
this.env = env;
this.dir = dir;
this.user = user;
this.groups = groups;
this.tty = tty;
this.mounts = mounts;
this.stopGracePeriod = stopGracePeriod;
}
@JsonProperty(value = "Image")
@Override
public String image() {
return image;
}
@Nullable
@JsonProperty(value = "Labels")
@Override
public ImmutableMap labels() {
return labels;
}
@JsonProperty(value = "Command")
@Override
public ImmutableList command() {
return command;
}
@Nullable
@JsonProperty(value = "Args")
@Override
public ImmutableList args() {
return args;
}
@Nullable
@JsonProperty(value = "Env")
@Override
public ImmutableList env() {
return env;
}
@Nullable
@JsonProperty(value = "Dir")
@Override
public String dir() {
return dir;
}
@Nullable
@JsonProperty(value = "User")
@Override
public String user() {
return user;
}
@Nullable
@JsonProperty(value = "Groups")
@Override
public ImmutableList groups() {
return groups;
}
@Nullable
@JsonProperty(value = "TTY")
@Override
public Boolean tty() {
return tty;
}
@Nullable
@JsonProperty(value = "Mounts")
@Override
public ImmutableList mounts() {
return mounts;
}
@Nullable
@JsonProperty(value = "StopGracePeriod")
@Override
public Long stopGracePeriod() {
return stopGracePeriod;
}
@Override
public String toString() {
return "ContainerSpec{"
+ "image=" + image + ", "
+ "labels=" + labels + ", "
+ "command=" + command + ", "
+ "args=" + args + ", "
+ "env=" + env + ", "
+ "dir=" + dir + ", "
+ "user=" + user + ", "
+ "groups=" + groups + ", "
+ "tty=" + tty + ", "
+ "mounts=" + mounts + ", "
+ "stopGracePeriod=" + stopGracePeriod
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ContainerSpec) {
ContainerSpec that = (ContainerSpec) o;
return (this.image.equals(that.image()))
&& ((this.labels == null) ? (that.labels() == null) : this.labels.equals(that.labels()))
&& (this.command.equals(that.command()))
&& ((this.args == null) ? (that.args() == null) : this.args.equals(that.args()))
&& ((this.env == null) ? (that.env() == null) : this.env.equals(that.env()))
&& ((this.dir == null) ? (that.dir() == null) : this.dir.equals(that.dir()))
&& ((this.user == null) ? (that.user() == null) : this.user.equals(that.user()))
&& ((this.groups == null) ? (that.groups() == null) : this.groups.equals(that.groups()))
&& ((this.tty == null) ? (that.tty() == null) : this.tty.equals(that.tty()))
&& ((this.mounts == null) ? (that.mounts() == null) : this.mounts.equals(that.mounts()))
&& ((this.stopGracePeriod == null) ? (that.stopGracePeriod() == null) : this.stopGracePeriod.equals(that.stopGracePeriod()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.image.hashCode();
h *= 1000003;
h ^= (labels == null) ? 0 : this.labels.hashCode();
h *= 1000003;
h ^= this.command.hashCode();
h *= 1000003;
h ^= (args == null) ? 0 : this.args.hashCode();
h *= 1000003;
h ^= (env == null) ? 0 : this.env.hashCode();
h *= 1000003;
h ^= (dir == null) ? 0 : this.dir.hashCode();
h *= 1000003;
h ^= (user == null) ? 0 : this.user.hashCode();
h *= 1000003;
h ^= (groups == null) ? 0 : this.groups.hashCode();
h *= 1000003;
h ^= (tty == null) ? 0 : this.tty.hashCode();
h *= 1000003;
h ^= (mounts == null) ? 0 : this.mounts.hashCode();
h *= 1000003;
h ^= (stopGracePeriod == null) ? 0 : this.stopGracePeriod.hashCode();
return h;
}
static final class Builder extends ContainerSpec.Builder {
private String image;
private ImmutableMap.Builder labelsBuilder$;
private ImmutableMap labels;
private ImmutableList command;
private ImmutableList args;
private ImmutableList env;
private String dir;
private String user;
private ImmutableList groups;
private Boolean tty;
private ImmutableList mounts;
private Long stopGracePeriod;
Builder() {
this.labels = ImmutableMap.of();
}
Builder(ContainerSpec source) {
this.image = source.image();
this.labels = source.labels();
this.command = source.command();
this.args = source.args();
this.env = source.env();
this.dir = source.dir();
this.user = source.user();
this.groups = source.groups();
this.tty = source.tty();
this.mounts = source.mounts();
this.stopGracePeriod = source.stopGracePeriod();
}
@Override
public ContainerSpec.Builder image(String image) {
this.image = image;
return this;
}
@Override
public ContainerSpec.Builder labels(@Nullable Map labels) {
if (labelsBuilder$ != null) {
throw new IllegalStateException("Cannot set labels after calling labelsBuilder()");
}
this.labels = (labels == null ? null : ImmutableMap.copyOf(labels));
return this;
}
@Override
public ImmutableMap.Builder labelsBuilder() {
if (labelsBuilder$ == null) {
labelsBuilder$ = ImmutableMap.builder();
labelsBuilder$.putAll(labels);
labels = null;
}
return labelsBuilder$;
}
@Override
public ContainerSpec.Builder command(String... command) {
this.command = ImmutableList.copyOf(command);
return this;
}
@Override
public ContainerSpec.Builder command(List command) {
this.command = ImmutableList.copyOf(command);
return this;
}
@Override
public ContainerSpec.Builder args(@Nullable String... args) {
this.args = (args == null ? null : ImmutableList.copyOf(args));
return this;
}
@Override
public ContainerSpec.Builder args(@Nullable List args) {
this.args = (args == null ? null : ImmutableList.copyOf(args));
return this;
}
@Override
public ContainerSpec.Builder env(@Nullable String... env) {
this.env = (env == null ? null : ImmutableList.copyOf(env));
return this;
}
@Override
public ContainerSpec.Builder env(@Nullable List env) {
this.env = (env == null ? null : ImmutableList.copyOf(env));
return this;
}
@Override
public ContainerSpec.Builder dir(@Nullable String dir) {
this.dir = dir;
return this;
}
@Override
public ContainerSpec.Builder user(@Nullable String user) {
this.user = user;
return this;
}
@Override
public ContainerSpec.Builder groups(@Nullable String... groups) {
this.groups = (groups == null ? null : ImmutableList.copyOf(groups));
return this;
}
@Override
public ContainerSpec.Builder groups(@Nullable List groups) {
this.groups = (groups == null ? null : ImmutableList.copyOf(groups));
return this;
}
@Override
public ContainerSpec.Builder tty(@Nullable Boolean tty) {
this.tty = tty;
return this;
}
@Override
public ContainerSpec.Builder mounts(@Nullable Mount... mounts) {
this.mounts = (mounts == null ? null : ImmutableList.copyOf(mounts));
return this;
}
@Override
public ContainerSpec.Builder mounts(@Nullable List mounts) {
this.mounts = (mounts == null ? null : ImmutableList.copyOf(mounts));
return this;
}
@Override
public ContainerSpec.Builder stopGracePeriod(@Nullable Long stopGracePeriod) {
this.stopGracePeriod = stopGracePeriod;
return this;
}
@Override
public ContainerSpec build() {
if (labelsBuilder$ != null) {
labels = labelsBuilder$.build();
}
String missing = "";
if (image == null) {
missing += " image";
}
if (command == null) {
missing += " command";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_ContainerSpec(
this.image,
this.labels,
this.command,
this.args,
this.env,
this.dir,
this.user,
this.groups,
this.tty,
this.mounts,
this.stopGracePeriod);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy