All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.spotify.docker.client.messages.AutoValue_NetworkConfig Maven / Gradle / Ivy

There is a newer version: 8.16.0
Show newest version

package com.spotify.docker.client.messages;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import javax.annotation.Generated;
import javax.annotation.Nullable;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
 final class AutoValue_NetworkConfig extends NetworkConfig {

  private final String name;
  private final String driver;
  private final Ipam ipam;
  private final ImmutableMap options;
  private final Boolean checkDuplicate;

  private AutoValue_NetworkConfig(
      String name,
      @Nullable String driver,
      @Nullable Ipam ipam,
      ImmutableMap options,
      @Nullable Boolean checkDuplicate) {
    this.name = name;
    this.driver = driver;
    this.ipam = ipam;
    this.options = options;
    this.checkDuplicate = checkDuplicate;
  }

  @JsonProperty(value = "Name")
  @Override
  public String name() {
    return name;
  }

  @Nullable
  @JsonProperty(value = "Driver")
  @Override
  public String driver() {
    return driver;
  }

  @Nullable
  @JsonProperty(value = "IPAM")
  @Override
  public Ipam ipam() {
    return ipam;
  }

  @JsonProperty(value = "Options")
  @Override
  public ImmutableMap options() {
    return options;
  }

  @Nullable
  @JsonProperty(value = "CheckDuplicate")
  @Override
  public Boolean checkDuplicate() {
    return checkDuplicate;
  }

  @Override
  public String toString() {
    return "NetworkConfig{"
        + "name=" + name + ", "
        + "driver=" + driver + ", "
        + "ipam=" + ipam + ", "
        + "options=" + options + ", "
        + "checkDuplicate=" + checkDuplicate
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof NetworkConfig) {
      NetworkConfig that = (NetworkConfig) o;
      return (this.name.equals(that.name()))
           && ((this.driver == null) ? (that.driver() == null) : this.driver.equals(that.driver()))
           && ((this.ipam == null) ? (that.ipam() == null) : this.ipam.equals(that.ipam()))
           && (this.options.equals(that.options()))
           && ((this.checkDuplicate == null) ? (that.checkDuplicate() == null) : this.checkDuplicate.equals(that.checkDuplicate()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.name.hashCode();
    h *= 1000003;
    h ^= (driver == null) ? 0 : this.driver.hashCode();
    h *= 1000003;
    h ^= (ipam == null) ? 0 : this.ipam.hashCode();
    h *= 1000003;
    h ^= this.options.hashCode();
    h *= 1000003;
    h ^= (checkDuplicate == null) ? 0 : this.checkDuplicate.hashCode();
    return h;
  }

  static final class Builder extends NetworkConfig.Builder {
    private String name;
    private String driver;
    private Ipam ipam;
    private ImmutableMap.Builder optionsBuilder$;
    private ImmutableMap options;
    private Boolean checkDuplicate;
    Builder() {
      this.options = ImmutableMap.of();
    }
    Builder(NetworkConfig source) {
      this.name = source.name();
      this.driver = source.driver();
      this.ipam = source.ipam();
      this.options = source.options();
      this.checkDuplicate = source.checkDuplicate();
    }
    @Override
    public NetworkConfig.Builder name(String name) {
      this.name = name;
      return this;
    }
    @Override
    public NetworkConfig.Builder driver(@Nullable String driver) {
      this.driver = driver;
      return this;
    }
    @Override
    public NetworkConfig.Builder ipam(@Nullable Ipam ipam) {
      this.ipam = ipam;
      return this;
    }
    @Override
    public NetworkConfig.Builder options(Map options) {
      if (optionsBuilder$ != null) {
        throw new IllegalStateException("Cannot set options after calling optionsBuilder()");
      }
      this.options = ImmutableMap.copyOf(options);
      return this;
    }
    @Override
    public ImmutableMap.Builder optionsBuilder() {
      if (optionsBuilder$ == null) {
        optionsBuilder$ = ImmutableMap.builder();
        optionsBuilder$.putAll(options);
        options = null;
      }
      return optionsBuilder$;
    }
    @Override
    public NetworkConfig.Builder checkDuplicate(@Nullable Boolean checkDuplicate) {
      this.checkDuplicate = checkDuplicate;
      return this;
    }
    @Override
    public NetworkConfig build() {
      if (optionsBuilder$ != null) {
        options = optionsBuilder$.build();
      }
      String missing = "";
      if (name == null) {
        missing += " name";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_NetworkConfig(
          this.name,
          this.driver,
          this.ipam,
          this.options,
          this.checkDuplicate);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy