Package nl.captcha

Class Captcha.Builder

java.lang.Object
nl.captcha.Captcha.Builder
All Implemented Interfaces:
Serializable
Enclosing class:
Captcha

public static class Captcha.Builder extends Object implements Serializable
See Also:
  • Constructor Details

    • Builder

      public Builder(int width, int height)
  • Method Details

    • addBackground

      public Captcha.Builder addBackground()
      Add a background using the default BackgroundProducer.
      Returns:
    • addBackground

      public Captcha.Builder addBackground(BackgroundProducer bgProd)
      Add a background using the given BackgroundProducer.
      Parameters:
      bgProd -
      Returns:
    • addText

      public Captcha.Builder addText()
      Add text to the image using the default TextProducer
      Returns:
    • addText

      public Captcha.Builder addText(TextProducer txtProd)
      Add text to the image using the given TextProducer
      Parameters:
      txtProd -
      Returns:
    • addText

      public Captcha.Builder addText(WordRenderer wRenderer)
      Display the answer on the image using the given WordRenderer.
      Parameters:
      wRenderer -
      Returns:
    • addText

      public Captcha.Builder addText(TextProducer txtProd, WordRenderer wRenderer)
    • addNoise

      public Captcha.Builder addNoise()
      Add noise using the default NoiseProducer.
      Returns:
    • addNoise

      public Captcha.Builder addNoise(NoiseProducer nProd)
      Add noise using the given NoiseProducer.
      Parameters:
      nProd -
      Returns:
    • gimp

      public Captcha.Builder gimp()
      Gimp the image using the default GimpyRenderer.
      Returns:
    • gimp

      public Captcha.Builder gimp(GimpyRenderer gimpy)
      Gimp the image using the given GimpyRenderer.
      Parameters:
      gimpy -
      Returns:
    • addBorder

      public Captcha.Builder addBorder()
      Draw a single-pixel wide black border around the image.
      Returns:
    • build

      public Captcha build()
      Build the CAPTCHA. This method should always be called, and should always be called last.
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object