
io.honnix.rkt.launcher.options.RunOptionsBuilder Maven / Gradle / Ivy
package io.honnix.rkt.launcher.options;
import io.honnix.rkt.launcher.model.Network;
import io.honnix.rkt.launcher.model.schema.type.Environment;
import io.honnix.rkt.launcher.model.schema.type.Mount;
import io.honnix.rkt.launcher.model.schema.type.Volume;
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 java.util.Optional;
import javax.annotation.Generated;
@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class RunOptionsBuilder {
private Optional> volume;
private Optional> mount;
private Optional podManifest;
private Optional> setEnv;
private Optional setEnvFile;
private Optional uuidFileSave;
private Optional> dns;
private Optional> dnsDomain;
private Optional> dnsOpt;
private Optional> dnsSearch;
private Optional hostname;
private Optional> hostsEntry;
private Optional mdsRegister;
private Optional> net;
private List imagesOptions;
public RunOptionsBuilder() {
this.volume = Optional.empty();
this.mount = Optional.empty();
this.podManifest = Optional.empty();
this.setEnv = Optional.empty();
this.setEnvFile = Optional.empty();
this.uuidFileSave = Optional.empty();
this.dns = Optional.empty();
this.dnsDomain = Optional.empty();
this.dnsOpt = Optional.empty();
this.dnsSearch = Optional.empty();
this.hostname = Optional.empty();
this.hostsEntry = Optional.empty();
this.mdsRegister = Optional.empty();
this.net = Optional.empty();
}
private RunOptionsBuilder(RunOptions v) {
this.volume = v.volume();
this.mount = v.mount();
this.podManifest = v.podManifest();
this.setEnv = v.setEnv();
this.setEnvFile = v.setEnvFile();
this.uuidFileSave = v.uuidFileSave();
this.dns = v.dns();
this.dnsDomain = v.dnsDomain();
this.dnsOpt = v.dnsOpt();
this.dnsSearch = v.dnsSearch();
this.hostname = v.hostname();
this.hostsEntry = v.hostsEntry();
this.mdsRegister = v.mdsRegister();
this.net = v.net();
List extends PerImageOptions> _imagesOptions = v.imagesOptions();
this.imagesOptions = (_imagesOptions == null) ? null : new ArrayList(_imagesOptions);
}
private RunOptionsBuilder(RunOptionsBuilder v) {
this.volume = v.volume;
this.mount = v.mount;
this.podManifest = v.podManifest;
this.setEnv = v.setEnv;
this.setEnvFile = v.setEnvFile;
this.uuidFileSave = v.uuidFileSave;
this.dns = v.dns;
this.dnsDomain = v.dnsDomain;
this.dnsOpt = v.dnsOpt;
this.dnsSearch = v.dnsSearch;
this.hostname = v.hostname;
this.hostsEntry = v.hostsEntry;
this.mdsRegister = v.mdsRegister;
this.net = v.net;
this.imagesOptions = (v.imagesOptions == null) ? null : new ArrayList(v.imagesOptions);
}
public Optional> volume() {
return volume;
}
public RunOptionsBuilder volume(List volume) {
return volume(Optional.ofNullable(volume));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder volume(Optional extends List> volume) {
if (volume == null) {
throw new NullPointerException("volume");
}
this.volume = (Optional>)volume;
return this;
}
public Optional> mount() {
return mount;
}
public RunOptionsBuilder mount(List mount) {
return mount(Optional.ofNullable(mount));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder mount(Optional extends List> mount) {
if (mount == null) {
throw new NullPointerException("mount");
}
this.mount = (Optional>)mount;
return this;
}
public Optional podManifest() {
return podManifest;
}
public RunOptionsBuilder podManifest(String podManifest) {
return podManifest(Optional.ofNullable(podManifest));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder podManifest(Optional extends String> podManifest) {
if (podManifest == null) {
throw new NullPointerException("podManifest");
}
this.podManifest = (Optional)podManifest;
return this;
}
public Optional> setEnv() {
return setEnv;
}
public RunOptionsBuilder setEnv(List setEnv) {
return setEnv(Optional.ofNullable(setEnv));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder setEnv(Optional extends List> setEnv) {
if (setEnv == null) {
throw new NullPointerException("setEnv");
}
this.setEnv = (Optional>)setEnv;
return this;
}
public Optional setEnvFile() {
return setEnvFile;
}
public RunOptionsBuilder setEnvFile(String setEnvFile) {
return setEnvFile(Optional.ofNullable(setEnvFile));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder setEnvFile(Optional extends String> setEnvFile) {
if (setEnvFile == null) {
throw new NullPointerException("setEnvFile");
}
this.setEnvFile = (Optional)setEnvFile;
return this;
}
public Optional uuidFileSave() {
return uuidFileSave;
}
public RunOptionsBuilder uuidFileSave(String uuidFileSave) {
return uuidFileSave(Optional.ofNullable(uuidFileSave));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder uuidFileSave(Optional extends String> uuidFileSave) {
if (uuidFileSave == null) {
throw new NullPointerException("uuidFileSave");
}
this.uuidFileSave = (Optional)uuidFileSave;
return this;
}
public Optional> dns() {
return dns;
}
public RunOptionsBuilder dns(List dns) {
return dns(Optional.ofNullable(dns));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder dns(Optional extends List> dns) {
if (dns == null) {
throw new NullPointerException("dns");
}
this.dns = (Optional>)dns;
return this;
}
public Optional> dnsDomain() {
return dnsDomain;
}
public RunOptionsBuilder dnsDomain(List dnsDomain) {
return dnsDomain(Optional.ofNullable(dnsDomain));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder dnsDomain(Optional extends List> dnsDomain) {
if (dnsDomain == null) {
throw new NullPointerException("dnsDomain");
}
this.dnsDomain = (Optional>)dnsDomain;
return this;
}
public Optional> dnsOpt() {
return dnsOpt;
}
public RunOptionsBuilder dnsOpt(List dnsOpt) {
return dnsOpt(Optional.ofNullable(dnsOpt));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder dnsOpt(Optional extends List> dnsOpt) {
if (dnsOpt == null) {
throw new NullPointerException("dnsOpt");
}
this.dnsOpt = (Optional>)dnsOpt;
return this;
}
public Optional> dnsSearch() {
return dnsSearch;
}
public RunOptionsBuilder dnsSearch(List dnsSearch) {
return dnsSearch(Optional.ofNullable(dnsSearch));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder dnsSearch(Optional extends List> dnsSearch) {
if (dnsSearch == null) {
throw new NullPointerException("dnsSearch");
}
this.dnsSearch = (Optional>)dnsSearch;
return this;
}
public Optional hostname() {
return hostname;
}
public RunOptionsBuilder hostname(String hostname) {
return hostname(Optional.ofNullable(hostname));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder hostname(Optional extends String> hostname) {
if (hostname == null) {
throw new NullPointerException("hostname");
}
this.hostname = (Optional)hostname;
return this;
}
public Optional> hostsEntry() {
return hostsEntry;
}
public RunOptionsBuilder hostsEntry(List hostsEntry) {
return hostsEntry(Optional.ofNullable(hostsEntry));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder hostsEntry(Optional extends List> hostsEntry) {
if (hostsEntry == null) {
throw new NullPointerException("hostsEntry");
}
this.hostsEntry = (Optional>)hostsEntry;
return this;
}
public Optional mdsRegister() {
return mdsRegister;
}
public RunOptionsBuilder mdsRegister(Boolean mdsRegister) {
return mdsRegister(Optional.ofNullable(mdsRegister));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder mdsRegister(Optional extends Boolean> mdsRegister) {
if (mdsRegister == null) {
throw new NullPointerException("mdsRegister");
}
this.mdsRegister = (Optional)mdsRegister;
return this;
}
public Optional> net() {
return net;
}
public RunOptionsBuilder net(List net) {
return net(Optional.ofNullable(net));
}
@SuppressWarnings("unchecked")
public RunOptionsBuilder net(Optional extends List> net) {
if (net == null) {
throw new NullPointerException("net");
}
this.net = (Optional>)net;
return this;
}
public List imagesOptions() {
if (this.imagesOptions == null) {
this.imagesOptions = new ArrayList();
}
return imagesOptions;
}
public RunOptionsBuilder imagesOptions(List extends PerImageOptions> imagesOptions) {
return imagesOptions((Collection extends PerImageOptions>) imagesOptions);
}
public RunOptionsBuilder imagesOptions(Collection extends PerImageOptions> imagesOptions) {
if (imagesOptions == null) {
throw new NullPointerException("imagesOptions");
}
for (PerImageOptions item : imagesOptions) {
if (item == null) {
throw new NullPointerException("imagesOptions: null item");
}
}
this.imagesOptions = new ArrayList(imagesOptions);
return this;
}
public RunOptionsBuilder imagesOptions(Iterable extends PerImageOptions> imagesOptions) {
if (imagesOptions == null) {
throw new NullPointerException("imagesOptions");
}
if (imagesOptions instanceof Collection) {
return imagesOptions((Collection extends PerImageOptions>) imagesOptions);
}
return imagesOptions(imagesOptions.iterator());
}
public RunOptionsBuilder imagesOptions(Iterator extends PerImageOptions> imagesOptions) {
if (imagesOptions == null) {
throw new NullPointerException("imagesOptions");
}
this.imagesOptions = new ArrayList();
while (imagesOptions.hasNext()) {
PerImageOptions item = imagesOptions.next();
if (item == null) {
throw new NullPointerException("imagesOptions: null item");
}
this.imagesOptions.add(item);
}
return this;
}
@SafeVarargs
public final RunOptionsBuilder imagesOptions(PerImageOptions... imagesOptions) {
if (imagesOptions == null) {
throw new NullPointerException("imagesOptions");
}
return imagesOptions(Arrays.asList(imagesOptions));
}
public RunOptionsBuilder addImagesOption(PerImageOptions imagesOption) {
if (imagesOption == null) {
throw new NullPointerException("imagesOption");
}
if (this.imagesOptions == null) {
this.imagesOptions = new ArrayList();
}
imagesOptions.add(imagesOption);
return this;
}
public RunOptions build() {
List _imagesOptions = (imagesOptions != null) ? Collections.unmodifiableList(new ArrayList(imagesOptions)) : Collections.emptyList();
return new Value(volume, mount, podManifest, setEnv, setEnvFile, uuidFileSave, dns, dnsDomain, dnsOpt, dnsSearch, hostname, hostsEntry, mdsRegister, net, _imagesOptions);
}
public static RunOptionsBuilder from(RunOptions v) {
return new RunOptionsBuilder(v);
}
public static RunOptionsBuilder from(RunOptionsBuilder v) {
return new RunOptionsBuilder(v);
}
private static final class Value implements RunOptions {
private final Optional> volume;
private final Optional> mount;
private final Optional podManifest;
private final Optional> setEnv;
private final Optional setEnvFile;
private final Optional uuidFileSave;
private final Optional> dns;
private final Optional> dnsDomain;
private final Optional> dnsOpt;
private final Optional> dnsSearch;
private final Optional hostname;
private final Optional> hostsEntry;
private final Optional mdsRegister;
private final Optional> net;
private final List imagesOptions;
private Value(@AutoMatter.Field("volume") Optional> volume, @AutoMatter.Field("mount") Optional> mount, @AutoMatter.Field("podManifest") Optional podManifest, @AutoMatter.Field("setEnv") Optional> setEnv, @AutoMatter.Field("setEnvFile") Optional setEnvFile, @AutoMatter.Field("uuidFileSave") Optional uuidFileSave, @AutoMatter.Field("dns") Optional> dns, @AutoMatter.Field("dnsDomain") Optional> dnsDomain, @AutoMatter.Field("dnsOpt") Optional> dnsOpt, @AutoMatter.Field("dnsSearch") Optional> dnsSearch, @AutoMatter.Field("hostname") Optional hostname, @AutoMatter.Field("hostsEntry") Optional> hostsEntry, @AutoMatter.Field("mdsRegister") Optional mdsRegister, @AutoMatter.Field("net") Optional> net, @AutoMatter.Field("imagesOptions") List imagesOptions) {
if (volume == null) {
throw new NullPointerException("volume");
}
if (mount == null) {
throw new NullPointerException("mount");
}
if (podManifest == null) {
throw new NullPointerException("podManifest");
}
if (setEnv == null) {
throw new NullPointerException("setEnv");
}
if (setEnvFile == null) {
throw new NullPointerException("setEnvFile");
}
if (uuidFileSave == null) {
throw new NullPointerException("uuidFileSave");
}
if (dns == null) {
throw new NullPointerException("dns");
}
if (dnsDomain == null) {
throw new NullPointerException("dnsDomain");
}
if (dnsOpt == null) {
throw new NullPointerException("dnsOpt");
}
if (dnsSearch == null) {
throw new NullPointerException("dnsSearch");
}
if (hostname == null) {
throw new NullPointerException("hostname");
}
if (hostsEntry == null) {
throw new NullPointerException("hostsEntry");
}
if (mdsRegister == null) {
throw new NullPointerException("mdsRegister");
}
if (net == null) {
throw new NullPointerException("net");
}
this.volume = volume;
this.mount = mount;
this.podManifest = podManifest;
this.setEnv = setEnv;
this.setEnvFile = setEnvFile;
this.uuidFileSave = uuidFileSave;
this.dns = dns;
this.dnsDomain = dnsDomain;
this.dnsOpt = dnsOpt;
this.dnsSearch = dnsSearch;
this.hostname = hostname;
this.hostsEntry = hostsEntry;
this.mdsRegister = mdsRegister;
this.net = net;
this.imagesOptions = (imagesOptions != null) ? imagesOptions : Collections.emptyList();
}
@AutoMatter.Field
@Override
public Optional> volume() {
return volume;
}
@AutoMatter.Field
@Override
public Optional> mount() {
return mount;
}
@AutoMatter.Field
@Override
public Optional podManifest() {
return podManifest;
}
@AutoMatter.Field
@Override
public Optional> setEnv() {
return setEnv;
}
@AutoMatter.Field
@Override
public Optional setEnvFile() {
return setEnvFile;
}
@AutoMatter.Field
@Override
public Optional uuidFileSave() {
return uuidFileSave;
}
@AutoMatter.Field
@Override
public Optional> dns() {
return dns;
}
@AutoMatter.Field
@Override
public Optional> dnsDomain() {
return dnsDomain;
}
@AutoMatter.Field
@Override
public Optional> dnsOpt() {
return dnsOpt;
}
@AutoMatter.Field
@Override
public Optional> dnsSearch() {
return dnsSearch;
}
@AutoMatter.Field
@Override
public Optional hostname() {
return hostname;
}
@AutoMatter.Field
@Override
public Optional> hostsEntry() {
return hostsEntry;
}
@AutoMatter.Field
@Override
public Optional mdsRegister() {
return mdsRegister;
}
@AutoMatter.Field
@Override
public Optional> net() {
return net;
}
@AutoMatter.Field
@Override
public List imagesOptions() {
return imagesOptions;
}
public RunOptionsBuilder builder() {
return new RunOptionsBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof RunOptions)) {
return false;
}
final RunOptions that = (RunOptions) o;
if (volume != null ? !volume.equals(that.volume()) : that.volume() != null) {
return false;
}
if (mount != null ? !mount.equals(that.mount()) : that.mount() != null) {
return false;
}
if (podManifest != null ? !podManifest.equals(that.podManifest()) : that.podManifest() != null) {
return false;
}
if (setEnv != null ? !setEnv.equals(that.setEnv()) : that.setEnv() != null) {
return false;
}
if (setEnvFile != null ? !setEnvFile.equals(that.setEnvFile()) : that.setEnvFile() != null) {
return false;
}
if (uuidFileSave != null ? !uuidFileSave.equals(that.uuidFileSave()) : that.uuidFileSave() != null) {
return false;
}
if (dns != null ? !dns.equals(that.dns()) : that.dns() != null) {
return false;
}
if (dnsDomain != null ? !dnsDomain.equals(that.dnsDomain()) : that.dnsDomain() != null) {
return false;
}
if (dnsOpt != null ? !dnsOpt.equals(that.dnsOpt()) : that.dnsOpt() != null) {
return false;
}
if (dnsSearch != null ? !dnsSearch.equals(that.dnsSearch()) : that.dnsSearch() != null) {
return false;
}
if (hostname != null ? !hostname.equals(that.hostname()) : that.hostname() != null) {
return false;
}
if (hostsEntry != null ? !hostsEntry.equals(that.hostsEntry()) : that.hostsEntry() != null) {
return false;
}
if (mdsRegister != null ? !mdsRegister.equals(that.mdsRegister()) : that.mdsRegister() != null) {
return false;
}
if (net != null ? !net.equals(that.net()) : that.net() != null) {
return false;
}
if (imagesOptions != null ? !imagesOptions.equals(that.imagesOptions()) : that.imagesOptions() != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = 1;
long temp;
result = 31 * result + (volume != null ? volume.hashCode() : 0);
result = 31 * result + (mount != null ? mount.hashCode() : 0);
result = 31 * result + (podManifest != null ? podManifest.hashCode() : 0);
result = 31 * result + (setEnv != null ? setEnv.hashCode() : 0);
result = 31 * result + (setEnvFile != null ? setEnvFile.hashCode() : 0);
result = 31 * result + (uuidFileSave != null ? uuidFileSave.hashCode() : 0);
result = 31 * result + (dns != null ? dns.hashCode() : 0);
result = 31 * result + (dnsDomain != null ? dnsDomain.hashCode() : 0);
result = 31 * result + (dnsOpt != null ? dnsOpt.hashCode() : 0);
result = 31 * result + (dnsSearch != null ? dnsSearch.hashCode() : 0);
result = 31 * result + (hostname != null ? hostname.hashCode() : 0);
result = 31 * result + (hostsEntry != null ? hostsEntry.hashCode() : 0);
result = 31 * result + (mdsRegister != null ? mdsRegister.hashCode() : 0);
result = 31 * result + (net != null ? net.hashCode() : 0);
result = 31 * result + (imagesOptions != null ? imagesOptions.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "RunOptions{" +
"volume=" + volume +
", mount=" + mount +
", podManifest=" + podManifest +
", setEnv=" + setEnv +
", setEnvFile=" + setEnvFile +
", uuidFileSave=" + uuidFileSave +
", dns=" + dns +
", dnsDomain=" + dnsDomain +
", dnsOpt=" + dnsOpt +
", dnsSearch=" + dnsSearch +
", hostname=" + hostname +
", hostsEntry=" + hostsEntry +
", mdsRegister=" + mdsRegister +
", net=" + net +
", imagesOptions=" + imagesOptions +
'}';
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy