Record Class OttVerificationResult
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.application.ott.OttVerificationResult
- Record Components:
status- what happened.channel- the channel the accepted code was delivered through;nullunless the code was accepted.
public record OttVerificationResult(OttVerificationResult.Status status, OttChannel channel)
extends Record
Outcome of the verification of a one-time code.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat happened when a code was verified. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OttChannelThe field for thechannelrecord component.private static final OttVerificationResultResult of a wrong, expired, burnt or already used code.private static final OttVerificationResultResult when the second factor of the user is locked.private final OttVerificationResult.StatusThe field for thestatusrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionOttVerificationResult(OttVerificationResult.Status status, OttChannel channel) Creates an instance of aOttVerificationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchannel()Returns the value of thechannelrecord component.final booleanIndicates whether some other object is "equal to" this one.static OttVerificationResultfailure()Returns the result of a rejected code.final inthashCode()Returns a hash code value for this object.booleanTells whether the code was accepted.static OttVerificationResultlocked()Returns the result of a locked second factor.status()Returns the value of thestatusrecord component.static OttVerificationResultsuccess(OttChannel channel) Creates the result of an accepted code.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
Constructor Details
-
Method Details
-
success
Creates the result of an accepted code.- Parameters:
channel- the channel of the code.- Returns:
- the result.
-
failure
Returns the result of a rejected code.- Returns:
- the result.
-
locked
Returns the result of a locked second factor.- Returns:
- the result.
-
isSuccess
public boolean isSuccess()Tells whether the code was accepted.- Returns:
trueforOttVerificationResult.Status.SUCCESS.
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
channel
Returns the value of thechannelrecord component.- Returns:
- the value of the
channelrecord component
-