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

    Constructors
    Constructor
    Description
    RenderedCaptcha(String answer, String image)
    Creates an instance of a RenderedCaptcha record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    服务端内部读取答案;禁止将该属性输出到 JSON。
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the image record component.
    不返回答案明文或图片内容,避免内部结果进入日志时泄漏。

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RenderedCaptcha

      public RenderedCaptcha(String answer, String image)
      Creates an instance of a RenderedCaptcha record class.
      Parameters:
      answer - the value for the answer record component
      image - the value for the image record component
  • Method Details

    • answer

      public String answer()
      服务端内部读取答案;禁止将该属性输出到 JSON。
    • toString

      public String toString()
      不返回答案明文或图片内容,避免内部结果进入日志时泄漏。
      Specified by:
      toString in class Record
    • 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 Objects::equals(Object,Object).
      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.
    • image

      public String image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component