// Generated by delombok at Sun Nov 06 21:21:45 CET 2022

public class BuilderWithDeprecatedField {
  private String bar;
  @Deprecated
  private String foo;
  @Deprecated
  private java.util.List<String> xyzs;

  @java.lang.SuppressWarnings("all")
  BuilderWithDeprecatedField(final String bar, final String foo, final java.util.List<String> xyzs) {
    this.bar = bar;
    this.foo = foo;
    this.xyzs = xyzs;
  }


  @java.lang.SuppressWarnings("all")
  public static class BuilderWithDeprecatedFieldBuilder {
    @java.lang.SuppressWarnings("all")
    private String bar;
    @java.lang.SuppressWarnings("all")
    private String foo;
    @java.lang.SuppressWarnings("all")
    private java.util.ArrayList<String> xyzs;

    @java.lang.SuppressWarnings("all")
    BuilderWithDeprecatedFieldBuilder() {
    }

    /**
     * @return {@code this}.
     */
    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder bar(final String bar) {
      this.bar = bar;
      return this;
    }

    /**
     * @return {@code this}.
     */
    @java.lang.Deprecated
    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder foo(final String foo) {
      this.foo = foo;
      return this;
    }

    @java.lang.Deprecated
    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder xyz(final String xyz) {
      if (this.xyzs == null) this.xyzs = new java.util.ArrayList<String>();
      this.xyzs.add(xyz);
      return this;
    }

    @java.lang.Deprecated
    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder xyzs(final java.util.Collection<? extends String> xyzs) {
      if (xyzs == null) {
        throw new java.lang.NullPointerException("xyzs cannot be null");
      }
      if (this.xyzs == null) this.xyzs = new java.util.ArrayList<String>();
      this.xyzs.addAll(xyzs);
      return this;
    }

    @java.lang.Deprecated
    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder clearXyzs() {
      if (this.xyzs != null) this.xyzs.clear();
      return this;
    }

    @java.lang.SuppressWarnings("all")
    public BuilderWithDeprecatedField build() {
      java.util.List<String> xyzs;
      switch (this.xyzs == null ? 0 : this.xyzs.size()) {
      case 0: 
        xyzs = java.util.Collections.emptyList();
        break;
      case 1: 
        xyzs = java.util.Collections.singletonList(this.xyzs.get(0));
        break;
      default: 
        xyzs = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.xyzs));
      }
      return new BuilderWithDeprecatedField(this.bar, this.foo, xyzs);
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    public java.lang.String toString() {
      return "BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder(bar=" + this.bar + ", foo=" + this.foo + ", xyzs=" + this.xyzs + ")";
    }
  }

  @java.lang.SuppressWarnings("all")
  public static BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder builder() {
    return new BuilderWithDeprecatedField.BuilderWithDeprecatedFieldBuilder();
  }
}
