Class PhoneDtoMapper
java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.PhoneDtoMapper
Maps the results of the phone use cases onto the DTOs generated from the contract. The number is never shown whole:
only its last digits are.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final charCharacter that replaces a hidden digit.(package private) static final intNumber of trailing digits of the number that are shown. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringHides every digit of an E.164 number but the last ones, keeping the+and the length.toResponse(PhoneEnrolmentStarted started) Maps a started enrolment.toResponse(UserPhone phone) Maps a verified phone.
-
Field Details
-
VISIBLE_DIGITS
static final int VISIBLE_DIGITSNumber of trailing digits of the number that are shown.- See Also:
-
HIDDEN_DIGIT
static final char HIDDEN_DIGITCharacter that replaces a hidden digit.- See Also:
-
-
Constructor Details
-
PhoneDtoMapper
public PhoneDtoMapper()
-
-
Method Details
-
toResponse
Maps a verified phone.- Parameters:
phone- the verified phone.- Returns:
- the phone with its number masked, such as
+*******1222.
-
toResponse
Maps a started enrolment.- Parameters:
started- the started enrolment.- Returns:
- the answer, with how long the code stays valid.
-
mask
Hides every digit of an E.164 number but the last ones, keeping the+and the length.- Parameters:
e164- the number.- Returns:
- the masked number.
-