Class Captcha.Builder

  • Enclosing class:
    Captcha

    public static class Captcha.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • url

        public Captcha.Builder url​(String url)
        The unique URL path at which to show the CAPTCHA challenge.
        Parameters:
        url - the value to set
        Returns:
        this builder
      • sessionExpirationInSeconds

        public Captcha.Builder sessionExpirationInSeconds​(Integer sessionExpirationInSeconds)
        The amount of time before the CAPTCHA expires, in seconds.

        If unspecified, defaults to 300.

        Parameters:
        sessionExpirationInSeconds - the value to set
        Returns:
        this builder
      • title

        public Captcha.Builder title​(String title)
        The title used when displaying a CAPTCHA challenge.

        If unspecified, defaults to Are you human?

        Parameters:
        title - the value to set
        Returns:
        this builder
      • headerText

        public Captcha.Builder headerText​(String headerText)
        The text to show in the header when showing a CAPTCHA challenge.

        If unspecified, defaults to ‘We have detected an increased number of attempts to access this website. To help us keep this site secure, please let us know that you are not a robot by entering the text from the image below.’

        Parameters:
        headerText - the value to set
        Returns:
        this builder
      • footerText

        public Captcha.Builder footerText​(String footerText)
        The text to show in the footer when showing a CAPTCHA challenge.

        If unspecified, defaults to ‘Enter the letters and numbers as they are shown in the image above.’

        Parameters:
        footerText - the value to set
        Returns:
        this builder
      • failureMessage

        public Captcha.Builder failureMessage​(String failureMessage)
        The text to show when incorrect CAPTCHA text is entered.

        If unspecified, defaults to The CAPTCHA was incorrect. Try again.

        Parameters:
        failureMessage - the value to set
        Returns:
        this builder
      • submitLabel

        public Captcha.Builder submitLabel​(String submitLabel)
        The text to show on the label of the CAPTCHA challenge submit button.

        If unspecified, defaults to Yes, I am human.

        Parameters:
        submitLabel - the value to set
        Returns:
        this builder