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

com.spotify.styx.model.FlyteExecConfBuilder Maven / Gradle / Ivy

package com.spotify.styx.model;

import io.norberg.automatter.AutoMatter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
@AutoMatter.Generated
public final class FlyteExecConfBuilder {
  private FlyteIdentifier referenceId;

  private Map inputFields;

  public FlyteExecConfBuilder() {
  }

  private FlyteExecConfBuilder(FlyteExecConf v) {
    this.referenceId = v.referenceId();
    Map _inputFields = v.inputFields();
    this.inputFields = (_inputFields == null) ? null : new HashMap(_inputFields);
  }

  private FlyteExecConfBuilder(FlyteExecConfBuilder v) {
    this.referenceId = v.referenceId();
    this.inputFields = new HashMap(v.inputFields());
  }

  public FlyteIdentifier referenceId() {
    return referenceId;
  }

  public FlyteExecConfBuilder referenceId(FlyteIdentifier referenceId) {
    if (referenceId == null) {
      throw new NullPointerException("referenceId");
    }
    this.referenceId = referenceId;
    return this;
  }

  public Map inputFields() {
    if (this.inputFields == null) {
      this.inputFields = new HashMap();
    }
    return inputFields;
  }

  public FlyteExecConfBuilder inputFields(Map inputFields) {
    if (inputFields == null) {
      throw new NullPointerException("inputFields");
    }
    for (Map.Entry entry : inputFields.entrySet()) {
      if (entry.getKey() == null) {
        throw new NullPointerException("inputFields: null key");
      }
      if (entry.getValue() == null) {
        throw new NullPointerException("inputFields: null value");
      }
    }
    this.inputFields = new HashMap(inputFields);
    return this;
  }

  public FlyteExecConfBuilder inputFields(String k1, String v1) {
    if (k1 == null) {
      throw new NullPointerException("inputFields: k1");
    }
    if (v1 == null) {
      throw new NullPointerException("inputFields: v1");
    }
    inputFields = new HashMap();
    inputFields.put(k1, v1);
    return this;
  }

  public FlyteExecConfBuilder inputFields(String k1, String v1, String k2, String v2) {
    inputFields(k1, v1);
    if (k2 == null) {
      throw new NullPointerException("inputFields: k2");
    }
    if (v2 == null) {
      throw new NullPointerException("inputFields: v2");
    }
    inputFields.put(k2, v2);
    return this;
  }

  public FlyteExecConfBuilder inputFields(String k1, String v1, String k2, String v2, String k3,
      String v3) {
    inputFields(k1, v1, k2, v2);
    if (k3 == null) {
      throw new NullPointerException("inputFields: k3");
    }
    if (v3 == null) {
      throw new NullPointerException("inputFields: v3");
    }
    inputFields.put(k3, v3);
    return this;
  }

  public FlyteExecConfBuilder inputFields(String k1, String v1, String k2, String v2, String k3,
      String v3, String k4, String v4) {
    inputFields(k1, v1, k2, v2, k3, v3);
    if (k4 == null) {
      throw new NullPointerException("inputFields: k4");
    }
    if (v4 == null) {
      throw new NullPointerException("inputFields: v4");
    }
    inputFields.put(k4, v4);
    return this;
  }

  public FlyteExecConfBuilder inputFields(String k1, String v1, String k2, String v2, String k3,
      String v3, String k4, String v4, String k5, String v5) {
    inputFields(k1, v1, k2, v2, k3, v3, k4, v4);
    if (k5 == null) {
      throw new NullPointerException("inputFields: k5");
    }
    if (v5 == null) {
      throw new NullPointerException("inputFields: v5");
    }
    inputFields.put(k5, v5);
    return this;
  }

  public FlyteExecConfBuilder putInputField(String key, String value) {
    if (key == null) {
      throw new NullPointerException("inputField: key");
    }
    if (value == null) {
      throw new NullPointerException("inputField: value");
    }
    if (this.inputFields == null) {
      this.inputFields = new HashMap();
    }
    inputFields.put(key, value);
    return this;
  }

  public FlyteExecConf build() {
    Map _inputFields = (inputFields != null) ? Collections.unmodifiableMap(new HashMap(inputFields)) : Collections.emptyMap();
    return new Value(referenceId, _inputFields);
  }

  public static FlyteExecConfBuilder from(FlyteExecConf v) {
    return new FlyteExecConfBuilder(v);
  }

  public static FlyteExecConfBuilder from(FlyteExecConfBuilder v) {
    return new FlyteExecConfBuilder(v);
  }

  @AutoMatter.Generated
  private static final class Value implements FlyteExecConf {
    private final FlyteIdentifier referenceId;

    private final Map inputFields;

    private Value(@AutoMatter.Field("referenceId") FlyteIdentifier referenceId,
        @AutoMatter.Field("inputFields") Map inputFields) {
      if (referenceId == null) {
        throw new NullPointerException("referenceId");
      }
      this.referenceId = referenceId;
      this.inputFields = (inputFields != null) ? inputFields : Collections.emptyMap();
    }

    @AutoMatter.Field
    @Override
    public FlyteIdentifier referenceId() {
      return referenceId;
    }

    @AutoMatter.Field
    @Override
    public Map inputFields() {
      return inputFields;
    }

    public FlyteExecConfBuilder builder() {
      return new FlyteExecConfBuilder(this);
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof FlyteExecConf)) {
        return false;
      }
      final FlyteExecConf that = (FlyteExecConf) o;
      if (referenceId != null ? !referenceId.equals(that.referenceId()) : that.referenceId() != null) {
        return false;
      }
      if (inputFields != null ? !inputFields.equals(that.inputFields()) : that.inputFields() != null) {
        return false;
      }
      return true;
    }

    @Override
    public int hashCode() {
      int result = 1;
      result = 31 * result + (this.referenceId != null ? this.referenceId.hashCode() : 0);
      result = 31 * result + (this.inputFields != null ? this.inputFields.hashCode() : 0);
      return result;
    }

    @Override
    public String toString() {
      return "FlyteExecConf{" +
      "referenceId=" + referenceId +
      ", inputFields=" + inputFields +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy