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

com.hubspot.chrome.devtools.client.core.network.AuthChallenge Maven / Gradle / Ivy

package com.hubspot.chrome.devtools.client.core.network;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Authorization challenge for HTTP status code 401 or 407.
 */
public final class AuthChallenge {
  private String source;

  private String origin;

  private String scheme;

  private String realm;

  @JsonCreator
  public AuthChallenge(@JsonProperty("source") String source, @JsonProperty("origin") String origin,
      @JsonProperty("scheme") String scheme, @JsonProperty("realm") String realm) {
    this.source = source;
    this.origin = origin;
    this.scheme = scheme;
    this.realm = realm;
  }

  public String getSource() {
    return source;
  }

  public String getOrigin() {
    return origin;
  }

  public String getScheme() {
    return scheme;
  }

  public String getRealm() {
    return realm;
  }

  public static AuthChallenge.Builder builder() {
    return new AuthChallenge.Builder();
  }

  public static final class Builder {
    private String source;

    private String origin;

    private String scheme;

    private String realm;

    private Builder() {
    }

    public AuthChallenge.Builder setSource(String source) {
      this.source = source;
      return this;
    }

    public AuthChallenge.Builder setOrigin(String origin) {
      this.origin = origin;
      return this;
    }

    public AuthChallenge.Builder setScheme(String scheme) {
      this.scheme = scheme;
      return this;
    }

    public AuthChallenge.Builder setRealm(String realm) {
      this.realm = realm;
      return this;
    }

    public AuthChallenge build() {
      return new AuthChallenge(source, origin, scheme, realm);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy