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

com.spotify.docker.client.messages.swarm.AutoValue_PortConfig Maven / Gradle / Ivy

There is a newer version: 8.16.0
Show newest version

package com.spotify.docker.client.messages.swarm;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

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

  private final String name;
  private final String protocol;
  private final Integer targetPort;
  private final Integer publishedPort;

  private AutoValue_PortConfig(
      String name,
      String protocol,
      Integer targetPort,
      Integer publishedPort) {
    this.name = name;
    this.protocol = protocol;
    this.targetPort = targetPort;
    this.publishedPort = publishedPort;
  }

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

  @JsonProperty(value = "Protocol")
  @Override
  public String protocol() {
    return protocol;
  }

  @JsonProperty(value = "TargetPort")
  @Override
  public Integer targetPort() {
    return targetPort;
  }

  @JsonProperty(value = "PublishedPort")
  @Override
  public Integer publishedPort() {
    return publishedPort;
  }

  @Override
  public String toString() {
    return "PortConfig{"
        + "name=" + name + ", "
        + "protocol=" + protocol + ", "
        + "targetPort=" + targetPort + ", "
        + "publishedPort=" + publishedPort
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof PortConfig) {
      PortConfig that = (PortConfig) o;
      return (this.name.equals(that.name()))
           && (this.protocol.equals(that.protocol()))
           && (this.targetPort.equals(that.targetPort()))
           && (this.publishedPort.equals(that.publishedPort()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.name.hashCode();
    h *= 1000003;
    h ^= this.protocol.hashCode();
    h *= 1000003;
    h ^= this.targetPort.hashCode();
    h *= 1000003;
    h ^= this.publishedPort.hashCode();
    return h;
  }

  static final class Builder extends PortConfig.Builder {
    private String name;
    private String protocol;
    private Integer targetPort;
    private Integer publishedPort;
    Builder() {
    }
    Builder(PortConfig source) {
      this.name = source.name();
      this.protocol = source.protocol();
      this.targetPort = source.targetPort();
      this.publishedPort = source.publishedPort();
    }
    @Override
    public PortConfig.Builder name(String name) {
      this.name = name;
      return this;
    }
    @Override
    public PortConfig.Builder protocol(String protocol) {
      this.protocol = protocol;
      return this;
    }
    @Override
    public PortConfig.Builder targetPort(Integer targetPort) {
      this.targetPort = targetPort;
      return this;
    }
    @Override
    public PortConfig.Builder publishedPort(Integer publishedPort) {
      this.publishedPort = publishedPort;
      return this;
    }
    @Override
    public PortConfig build() {
      String missing = "";
      if (name == null) {
        missing += " name";
      }
      if (protocol == null) {
        missing += " protocol";
      }
      if (targetPort == null) {
        missing += " targetPort";
      }
      if (publishedPort == null) {
        missing += " publishedPort";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_PortConfig(
          this.name,
          this.protocol,
          this.targetPort,
          this.publishedPort);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy