Record Class SignInMethods

java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.social.SignInMethods
Record Components:
password - whether the account has a password its owner knows.
federatedIdentities - number of linked external identities.
passkey - whether the account has a registered passkey.
certificates - number of bound client certificates.

public record SignInMethods(boolean password, long federatedIdentities, boolean passkey, long certificates) extends Record
The ways an account can sign in with. A use case that removes one asks for the methods without it (withoutFederatedIdentity(), withoutCertificate()) and refuses the removal when none is left.
  • Field Details

    • password

      private final boolean password
      The field for the password record component.
    • federatedIdentities

      private final long federatedIdentities
      The field for the federatedIdentities record component.
    • passkey

      private final boolean passkey
      The field for the passkey record component.
    • certificates

      private final long certificates
      The field for the certificates record component.
  • Constructor Details

    • SignInMethods

      public SignInMethods(boolean password, long federatedIdentities, boolean passkey, long certificates)
      Creates an instance of a SignInMethods record class.
      Parameters:
      password - the value for the password record component
      federatedIdentities - the value for the federatedIdentities record component
      passkey - the value for the passkey record component
      certificates - the value for the certificates record component
  • Method Details

    • any

      public boolean any()
      Tells whether any way to sign in is left.
      Returns:
      true when there is a password, an identity, a passkey or a certificate.
    • withoutFederatedIdentity

      public SignInMethods withoutFederatedIdentity()
      Counts the methods without one linked external identity.
      Returns:
      the methods once one identity is removed; the count never goes below zero.
    • withoutCertificate

      public SignInMethods withoutCertificate()
      Counts the methods without one bound client certificate.
      Returns:
      the methods once one certificate is unbound; the count never goes below zero.
    • toString

      public final 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 '=='.
      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.
    • password

      public boolean password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • federatedIdentities

      public long federatedIdentities()
      Returns the value of the federatedIdentities record component.
      Returns:
      the value of the federatedIdentities record component
    • passkey

      public boolean passkey()
      Returns the value of the passkey record component.
      Returns:
      the value of the passkey record component
    • certificates

      public long certificates()
      Returns the value of the certificates record component.
      Returns:
      the value of the certificates record component