Package com.adobe.aco.model
Class DiscountsPercentage
- java.lang.Object
-
- com.adobe.aco.model.DiscountsPercentage
-
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.4.0") public class DiscountsPercentage extends ObjectPercentage discount that reduces the regular price by a specified percentage. Example: $100 regular price with a 20% discount results in $80 final price.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiscountsPercentage.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_CODEstatic StringSERIALIZED_NAME_PERCENTAGE
-
Constructor Summary
Constructors Constructor Description DiscountsPercentage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DiscountsPercentagecode(String code)booleanequals(Object o)static DiscountsPercentagefromJson(String jsonString)Create an instance of DiscountsPercentage given an JSON stringStringgetCode()Unique identifier for the discount.FloatgetPercentage()Discount percentage as a positive number.inthashCode()DiscountsPercentagepercentage(Float percentage)voidsetCode(String code)voidsetPercentage(Float percentage)StringtoJson()Convert an instance of DiscountsPercentage to an JSON stringStringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement)Validates the JSON Element and throws an exception if issues found
-
-
-
Field Detail
-
SERIALIZED_NAME_CODE
public static final String SERIALIZED_NAME_CODE
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_PERCENTAGE
public static final String SERIALIZED_NAME_PERCENTAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
code
public DiscountsPercentage code(String code)
-
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)
-
percentage
public DiscountsPercentage percentage(Float percentage)
-
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)
-
validateJsonElement
public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOExceptionValidates 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
-
-