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

io.honnix.rkt.launcher.output.StopOutputBuilder Maven / Gradle / Ivy

There is a newer version: 0.0.8
Show newest version
package io.honnix.rkt.launcher.output;

import io.norberg.automatter.AutoMatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class StopOutputBuilder {
  private List stopped;

  public StopOutputBuilder() {
  }

  private StopOutputBuilder(StopOutput v) {
    List _stopped = v.stopped();
    this.stopped = (_stopped == null) ? null : new ArrayList(_stopped);
  }

  private StopOutputBuilder(StopOutputBuilder v) {
    this.stopped = (v.stopped == null) ? null : new ArrayList(v.stopped);
  }

  public List stopped() {
    if (this.stopped == null) {
      this.stopped = new ArrayList();
    }
    return stopped;
  }

  public StopOutputBuilder stopped(List stopped) {
    return stopped((Collection) stopped);
  }

  public StopOutputBuilder stopped(Collection stopped) {
    if (stopped == null) {
      throw new NullPointerException("stopped");
    }
    for (String item : stopped) {
      if (item == null) {
        throw new NullPointerException("stopped: null item");
      }
    }
    this.stopped = new ArrayList(stopped);
    return this;
  }

  public StopOutputBuilder stopped(Iterable stopped) {
    if (stopped == null) {
      throw new NullPointerException("stopped");
    }
    if (stopped instanceof Collection) {
      return stopped((Collection) stopped);
    }
    return stopped(stopped.iterator());
  }

  public StopOutputBuilder stopped(Iterator stopped) {
    if (stopped == null) {
      throw new NullPointerException("stopped");
    }
    this.stopped = new ArrayList();
    while (stopped.hasNext()) {
      String item = stopped.next();
      if (item == null) {
        throw new NullPointerException("stopped: null item");
      }
      this.stopped.add(item);
    }
    return this;
  }

  @SafeVarargs
  public final StopOutputBuilder stopped(String... stopped) {
    if (stopped == null) {
      throw new NullPointerException("stopped");
    }
    return stopped(Arrays.asList(stopped));
  }

  public StopOutput build() {
    List _stopped = (stopped != null) ? Collections.unmodifiableList(new ArrayList(stopped)) : Collections.emptyList();
    return new Value(_stopped);
  }

  public static StopOutputBuilder from(StopOutput v) {
    return new StopOutputBuilder(v);
  }

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

  private static final class Value implements StopOutput {
    private final List stopped;

    private Value(@AutoMatter.Field("stopped") List stopped) {
      this.stopped = (stopped != null) ? stopped : Collections.emptyList();
    }

    @AutoMatter.Field
    @Override
    public List stopped() {
      return stopped;
    }

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

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

    @Override
    public int hashCode() {
      int result = 1;
      long temp;
      result = 31 * result + (stopped != null ? stopped.hashCode() : 0);
      return result;
    }

    @Override
    public String toString() {
      return "StopOutput{" +
      "stopped=" + stopped +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy