Class DiscountsPercentage


  • @Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
               comments="Generator version: 7.4.0")
    public class DiscountsPercentage
    extends Object
    Percentage discount that reduces the regular price by a specified percentage. Example: $100 regular price with a 20% discount results in $80 final price.
    • Constructor Detail

      • DiscountsPercentage

        public DiscountsPercentage()
    • Method Detail

      • getCode

        @Nonnull
        public String getCode()
        Unique identifier for the discount. Must be unique within the price record. Use descriptive codes for easier management (e.g., \"seasonal_sale\", \"vip_member\").
        Returns:
        code
      • setCode

        public void setCode​(String code)
      • getPercentage

        @Nonnull
        public Float getPercentage()
        Discount percentage as a positive number. Valid range is 0.01 to 99.99 (1% to 99.99%).
        Returns:
        percentage
      • setPercentage

        public void setPercentage​(Float percentage)
      • hashCode

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

        public static void validateJsonElement​(com.google.gson.JsonElement jsonElement)
                                        throws IOException
        Validates the JSON Element and throws an exception if issues found
        Parameters:
        jsonElement - JSON Element
        Throws:
        IOException - if the JSON Element is invalid with respect to DiscountsPercentage
      • fromJson

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

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