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

io.honnix.rkt.launcher.options.GlobalOptionsBuilder Maven / Gradle / Ivy

package io.honnix.rkt.launcher.options;

import io.norberg.automatter.AutoMatter;
import java.util.List;
import java.util.Optional;
import javax.annotation.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class GlobalOptionsBuilder {
  private Optional dir;

  private Optional> insecureOptions;

  private Optional localConfig;

  private Optional systemConfig;

  private Optional trustKeysFromHttps;

  private Optional userConfig;

  public GlobalOptionsBuilder() {
    this.dir = Optional.empty();
    this.insecureOptions = Optional.empty();
    this.localConfig = Optional.empty();
    this.systemConfig = Optional.empty();
    this.trustKeysFromHttps = Optional.empty();
    this.userConfig = Optional.empty();
  }

  private GlobalOptionsBuilder(GlobalOptions v) {
    this.dir = v.dir();
    this.insecureOptions = v.insecureOptions();
    this.localConfig = v.localConfig();
    this.systemConfig = v.systemConfig();
    this.trustKeysFromHttps = v.trustKeysFromHttps();
    this.userConfig = v.userConfig();
  }

  private GlobalOptionsBuilder(GlobalOptionsBuilder v) {
    this.dir = v.dir;
    this.insecureOptions = v.insecureOptions;
    this.localConfig = v.localConfig;
    this.systemConfig = v.systemConfig;
    this.trustKeysFromHttps = v.trustKeysFromHttps;
    this.userConfig = v.userConfig;
  }

  public Optional dir() {
    return dir;
  }

  public GlobalOptionsBuilder dir(String dir) {
    return dir(Optional.ofNullable(dir));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder dir(Optional dir) {
    if (dir == null) {
      throw new NullPointerException("dir");
    }
    this.dir = (Optional)dir;
    return this;
  }

  public Optional> insecureOptions() {
    return insecureOptions;
  }

  public GlobalOptionsBuilder insecureOptions(List insecureOptions) {
    return insecureOptions(Optional.ofNullable(insecureOptions));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder insecureOptions(Optional> insecureOptions) {
    if (insecureOptions == null) {
      throw new NullPointerException("insecureOptions");
    }
    this.insecureOptions = (Optional>)insecureOptions;
    return this;
  }

  public Optional localConfig() {
    return localConfig;
  }

  public GlobalOptionsBuilder localConfig(String localConfig) {
    return localConfig(Optional.ofNullable(localConfig));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder localConfig(Optional localConfig) {
    if (localConfig == null) {
      throw new NullPointerException("localConfig");
    }
    this.localConfig = (Optional)localConfig;
    return this;
  }

  public Optional systemConfig() {
    return systemConfig;
  }

  public GlobalOptionsBuilder systemConfig(String systemConfig) {
    return systemConfig(Optional.ofNullable(systemConfig));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder systemConfig(Optional systemConfig) {
    if (systemConfig == null) {
      throw new NullPointerException("systemConfig");
    }
    this.systemConfig = (Optional)systemConfig;
    return this;
  }

  public Optional trustKeysFromHttps() {
    return trustKeysFromHttps;
  }

  public GlobalOptionsBuilder trustKeysFromHttps(Boolean trustKeysFromHttps) {
    return trustKeysFromHttps(Optional.ofNullable(trustKeysFromHttps));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder trustKeysFromHttps(Optional trustKeysFromHttps) {
    if (trustKeysFromHttps == null) {
      throw new NullPointerException("trustKeysFromHttps");
    }
    this.trustKeysFromHttps = (Optional)trustKeysFromHttps;
    return this;
  }

  public Optional userConfig() {
    return userConfig;
  }

  public GlobalOptionsBuilder userConfig(String userConfig) {
    return userConfig(Optional.ofNullable(userConfig));
  }

  @SuppressWarnings("unchecked")
  public GlobalOptionsBuilder userConfig(Optional userConfig) {
    if (userConfig == null) {
      throw new NullPointerException("userConfig");
    }
    this.userConfig = (Optional)userConfig;
    return this;
  }

  public GlobalOptions build() {
    return new Value(dir, insecureOptions, localConfig, systemConfig, trustKeysFromHttps, userConfig);
  }

  public static GlobalOptionsBuilder from(GlobalOptions v) {
    return new GlobalOptionsBuilder(v);
  }

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

  private static final class Value implements GlobalOptions {
    private final Optional dir;

    private final Optional> insecureOptions;

    private final Optional localConfig;

    private final Optional systemConfig;

    private final Optional trustKeysFromHttps;

    private final Optional userConfig;

    private Value(@AutoMatter.Field("dir") Optional dir, @AutoMatter.Field("insecureOptions") Optional> insecureOptions, @AutoMatter.Field("localConfig") Optional localConfig, @AutoMatter.Field("systemConfig") Optional systemConfig, @AutoMatter.Field("trustKeysFromHttps") Optional trustKeysFromHttps, @AutoMatter.Field("userConfig") Optional userConfig) {
      if (dir == null) {
        throw new NullPointerException("dir");
      }
      if (insecureOptions == null) {
        throw new NullPointerException("insecureOptions");
      }
      if (localConfig == null) {
        throw new NullPointerException("localConfig");
      }
      if (systemConfig == null) {
        throw new NullPointerException("systemConfig");
      }
      if (trustKeysFromHttps == null) {
        throw new NullPointerException("trustKeysFromHttps");
      }
      if (userConfig == null) {
        throw new NullPointerException("userConfig");
      }
      this.dir = dir;
      this.insecureOptions = insecureOptions;
      this.localConfig = localConfig;
      this.systemConfig = systemConfig;
      this.trustKeysFromHttps = trustKeysFromHttps;
      this.userConfig = userConfig;
    }

    @AutoMatter.Field
    @Override
    public Optional dir() {
      return dir;
    }

    @AutoMatter.Field
    @Override
    public Optional> insecureOptions() {
      return insecureOptions;
    }

    @AutoMatter.Field
    @Override
    public Optional localConfig() {
      return localConfig;
    }

    @AutoMatter.Field
    @Override
    public Optional systemConfig() {
      return systemConfig;
    }

    @AutoMatter.Field
    @Override
    public Optional trustKeysFromHttps() {
      return trustKeysFromHttps;
    }

    @AutoMatter.Field
    @Override
    public Optional userConfig() {
      return userConfig;
    }

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

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof GlobalOptions)) {
        return false;
      }
      final GlobalOptions that = (GlobalOptions) o;
      if (dir != null ? !dir.equals(that.dir()) : that.dir() != null) {
        return false;
      }
      if (insecureOptions != null ? !insecureOptions.equals(that.insecureOptions()) : that.insecureOptions() != null) {
        return false;
      }
      if (localConfig != null ? !localConfig.equals(that.localConfig()) : that.localConfig() != null) {
        return false;
      }
      if (systemConfig != null ? !systemConfig.equals(that.systemConfig()) : that.systemConfig() != null) {
        return false;
      }
      if (trustKeysFromHttps != null ? !trustKeysFromHttps.equals(that.trustKeysFromHttps()) : that.trustKeysFromHttps() != null) {
        return false;
      }
      if (userConfig != null ? !userConfig.equals(that.userConfig()) : that.userConfig() != null) {
        return false;
      }
      return true;
    }

    @Override
    public int hashCode() {
      int result = 1;
      long temp;
      result = 31 * result + (dir != null ? dir.hashCode() : 0);
      result = 31 * result + (insecureOptions != null ? insecureOptions.hashCode() : 0);
      result = 31 * result + (localConfig != null ? localConfig.hashCode() : 0);
      result = 31 * result + (systemConfig != null ? systemConfig.hashCode() : 0);
      result = 31 * result + (trustKeysFromHttps != null ? trustKeysFromHttps.hashCode() : 0);
      result = 31 * result + (userConfig != null ? userConfig.hashCode() : 0);
      return result;
    }

    @Override
    public String toString() {
      return "GlobalOptions{" +
      "dir=" + dir +
      ", insecureOptions=" + insecureOptions +
      ", localConfig=" + localConfig +
      ", systemConfig=" + systemConfig +
      ", trustKeysFromHttps=" + trustKeysFromHttps +
      ", userConfig=" + userConfig +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy