Record Class BasicAuthCredentials

java.lang.Object
java.lang.Record
com.codeborne.selenide.BasicAuthCredentials
All Implemented Interfaces:
Credentials

public record BasicAuthCredentials(String domain, String login, String password) extends Record implements Credentials
  • Constructor Summary

    Constructors
    Constructor
    Description
    Security warning: If you are using Selenide proxy, use another constructor (with domain parameter).
    BasicAuthCredentials(String domain, String login, String password)
    Creates an instance of a BasicAuthCredentials record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the domain record component.
    The resulting string is base64 encoded (e.g.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the login record component.
    Returns the value of the password record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BasicAuthCredentials

      public BasicAuthCredentials(String login, String password)
      Security warning: If you are using Selenide proxy, use another constructor (with domain parameter). This constructor is dangerous: without domain specified, Selenide proxy will send your credentials to ALL domains, including 3rd party services that your AUT or browser might call.

      If proxy is disabled, it's totally ok to use this constructor.

    • BasicAuthCredentials

      public BasicAuthCredentials(String domain, String login, String password)
      Creates an instance of a BasicAuthCredentials record class.
      Parameters:
      domain - the value for the domain record component
      login - the value for the login record component
      password - the value for the password record component
  • Method Details

    • encode

      public String encode()
      The resulting string is base64 encoded (e.g. "YWxhZGRpbjpvcGVuc2VzYW1l").
      Specified by:
      encode in interface Credentials
      Returns:
      encoded string
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • domain

      public String domain()
      Returns the value of the domain record component.
      Specified by:
      domain in interface Credentials
      Returns:
      the value of the domain record component
    • login

      public String login()
      Returns the value of the login record component.
      Returns:
      the value of the login record component
    • password

      public String password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component