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

io.honnix.rkt.launcher.model.config.BasicCredentialsBuilder Maven / Gradle / Ivy

package io.honnix.rkt.launcher.model.config;

import io.norberg.automatter.AutoMatter;
import javax.annotation.Generated;

@Generated("io.norberg.automatter.processor.AutoMatterProcessor")
public final class BasicCredentialsBuilder {
  private String user;

  private String password;

  public BasicCredentialsBuilder() {
  }

  private BasicCredentialsBuilder(Stage0Entry.DockerAuth.BasicCredentials v) {
    this.user = v.user();
    this.password = v.password();
  }

  private BasicCredentialsBuilder(BasicCredentialsBuilder v) {
    this.user = v.user;
    this.password = v.password;
  }

  public String user() {
    return user;
  }

  public BasicCredentialsBuilder user(String user) {
    if (user == null) {
      throw new NullPointerException("user");
    }
    this.user = user;
    return this;
  }

  public String password() {
    return password;
  }

  public BasicCredentialsBuilder password(String password) {
    if (password == null) {
      throw new NullPointerException("password");
    }
    this.password = password;
    return this;
  }

  public Stage0Entry.DockerAuth.BasicCredentials build() {
    return new Value(user, password);
  }

  public static BasicCredentialsBuilder from(Stage0Entry.DockerAuth.BasicCredentials v) {
    return new BasicCredentialsBuilder(v);
  }

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

  private static final class Value implements Stage0Entry.DockerAuth.BasicCredentials {
    private final String user;

    private final String password;

    private Value(@AutoMatter.Field("user") String user, @AutoMatter.Field("password") String password) {
      if (user == null) {
        throw new NullPointerException("user");
      }
      if (password == null) {
        throw new NullPointerException("password");
      }
      this.user = user;
      this.password = password;
    }

    @AutoMatter.Field
    @Override
    public String user() {
      return user;
    }

    @AutoMatter.Field
    @Override
    public String password() {
      return password;
    }

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

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof Stage0Entry.DockerAuth.BasicCredentials)) {
        return false;
      }
      final Stage0Entry.DockerAuth.BasicCredentials that = (Stage0Entry.DockerAuth.BasicCredentials) o;
      if (user != null ? !user.equals(that.user()) : that.user() != null) {
        return false;
      }
      if (password != null ? !password.equals(that.password()) : that.password() != null) {
        return false;
      }
      return true;
    }

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

    @Override
    public String toString() {
      return "Stage0Entry.DockerAuth.BasicCredentials{" +
      "user=" + user +
      ", password=" + password +
      '}';
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy