Record Class CaptchaImageRenderer.RenderedCaptcha
java.lang.Object
java.lang.Record
com.sankcrm.erp.auth.infrastructure.captcha.CaptchaImageRenderer.RenderedCaptcha
- Record Components:
answer- 图形验证码答案明文,仅供服务端计算摘要image- PNG 图片 data URL
- Enclosing class:
CaptchaImageRenderer
public static record CaptchaImageRenderer.RenderedCaptcha(String answer, String image)
extends Record
渲染结果的内部载体,不得暴露;答案访问器从 JSON 序列化中排除,且 toString 已脱敏。
-
Constructor Summary
ConstructorsConstructorDescriptionRenderedCaptcha(String answer, String image) Creates an instance of aRenderedCaptcharecord class. -
Method Summary
Modifier and TypeMethodDescriptionanswer()服务端内部读取答案;禁止将该属性输出到 JSON。final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.toString()不返回答案明文或图片内容,避免内部结果进入日志时泄漏。
-
Constructor Details
-
Method Details
-
answer
服务端内部读取答案;禁止将该属性输出到 JSON。 -
toString
不返回答案明文或图片内容,避免内部结果进入日志时泄漏。 -
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). -
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-