Record Class UserMFA.Answer

java.lang.Object
java.lang.Record
com.iizix.server.user.mfa.UserMFA.Answer
Record Components:
outcome - What became of it.
uid - The user ID the code was for, zero when there is none.
userName - The user name, null when there is none.
method - The method that was accepted, SignInPolicy.METHOD_TOTP or SignInPolicy.METHOD_RECOVERY; null when nothing was.
waitMs - The milliseconds the account still waits, for HELD_BACK.
driftSeconds - For a refused verification code: the seconds the clock of the code is off this server's, when the code would have matched within UserMFA.DRIFT_STEPS steps outside the verifier's window - positive when ahead, negative when behind (CC-FIX-SIGNIN-TOTP-ENROL, item 9); zero otherwise.
Enclosing class:
UserMFA

public static record UserMFA.Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs, int driftSeconds) extends Record
The answer to a code.
Author:
Christopher Mindus
  • Constructor Details

    • Answer

      public Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs)
      An answer that names no drift of a clock.
      Parameters:
      outcome - What became of it.
      uid - The user ID the code was for, zero when there is none.
      userName - The user name, null when there is none.
      method - The method that was accepted, null when nothing was.
      waitMs - The milliseconds the account still waits, for HELD_BACK.
    • Answer

      public Answer(UserMFA.Outcome outcome, long uid, String userName, String method, long waitMs, int driftSeconds)
      Creates an instance of a Answer record class.
      Parameters:
      outcome - the value for the outcome record component
      uid - the value for the uid record component
      userName - the value for the userName record component
      method - the value for the method record component
      waitMs - the value for the waitMs record component
      driftSeconds - the value for the driftSeconds record component
  • Method Details

    • accepted

      public boolean accepted()
      Checks if the code was accepted.
      Returns:
      true for ACCEPTED.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • outcome

      public UserMFA.Outcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • uid

      public long uid()
      Returns the value of the uid record component.
      Returns:
      the value of the uid record component
    • userName

      public String userName()
      Returns the value of the userName record component.
      Returns:
      the value of the userName record component
    • method

      public String method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • waitMs

      public long waitMs()
      Returns the value of the waitMs record component.
      Returns:
      the value of the waitMs record component
    • driftSeconds

      public int driftSeconds()
      Returns the value of the driftSeconds record component.
      Returns:
      the value of the driftSeconds record component