Class CodeConfig

java.lang.Object
io.voucherify.client.model.CodeConfig

@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class CodeConfig extends Object
Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).
  • Field Details

  • Constructor Details

    • CodeConfig

      public CodeConfig()
  • Method Details

    • length

      public CodeConfig length(BigDecimal length)
    • getLength

      @Nullable public BigDecimal getLength()
      Number of characters in a generated code (excluding prefix and postfix).
      Returns:
      length
    • setLength

      public void setLength(BigDecimal length)
    • charset

      public CodeConfig charset(String charset)
    • getCharset

      @Nullable public String getCharset()
      Characters that can appear in the code. Examples: - Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` - Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` - Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` - Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` - Numbers: `0123456789` - Custom: a custom character set
      Returns:
      charset
    • setCharset

      public void setCharset(String charset)
    • prefix

      public CodeConfig prefix(String prefix)
    • getPrefix

      @Nullable public String getPrefix()
      A text appended before the code.
      Returns:
      prefix
    • setPrefix

      public void setPrefix(String prefix)
    • postfix

      public CodeConfig postfix(String postfix)
    • getPostfix

      @Nullable public String getPostfix()
      A text appended after the code.
      Returns:
      postfix
    • setPostfix

      public void setPostfix(String postfix)
    • pattern

      public CodeConfig pattern(String pattern)
    • getPattern

      @Nullable public String getPattern()
      A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`.
      Returns:
      pattern
    • setPattern

      public void setPattern(String pattern)
    • initialCount

      public CodeConfig initialCount(Integer initialCount)
    • getInitialCount

      @Nullable public Integer getInitialCount()
      Internal value, does not change anything if provided.
      Returns:
      initialCount
    • setInitialCount

      public void setInitialCount(Integer initialCount)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromJson

      public static CodeConfig fromJson(String jsonString) throws IOException
      Create an instance of CodeConfig given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of CodeConfig
      Throws:
      IOException - if the JSON string is invalid with respect to CodeConfig
    • toJson

      public String toJson()
      Convert an instance of CodeConfig to an JSON string
      Returns:
      JSON string