Package com.apple.itunes.storekit.model
Class HelperValidationUtils
java.lang.Object
com.apple.itunes.storekit.model.HelperValidationUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringvalidateDescription(String description) Validates description is not null and does not exceed maximum length.static StringvalidateDisplayName(String displayName) Validates display name is not null and does not exceed maximum length.static <T extends AbstractAdvancedCommerceItem>
List<T> validateItems(List<T> list) Validates a list of items is not null, not empty, and contains no null elements.static IntegervalidatePeriodCount(Integer periodCount) Validates periodCount is not null and between `MIN_PERIOD` and `MAX_PERIOD` inclusive.static StringvalidateSku(String sku) Validates SKU does not exceed maximum length.
-
Field Details
-
MAXIMUM_DESCRIPTION_LENGTH
public static final int MAXIMUM_DESCRIPTION_LENGTH- See Also:
-
MAXIMUM_DISPLAY_NAME_LENGTH
public static final int MAXIMUM_DISPLAY_NAME_LENGTH- See Also:
-
-
Constructor Details
-
HelperValidationUtils
public HelperValidationUtils()
-
-
Method Details
-
validateDescription
Validates description is not null and does not exceed maximum length.- Parameters:
description- the description to validate- Returns:
- the validated description
- Throws:
IllegalArgumentException- if description exceeds maximum length
-
validateDisplayName
Validates display name is not null and does not exceed maximum length.- Parameters:
displayName- the display name to validate- Returns:
- the validated display name
- Throws:
IllegalArgumentException- if display name exceeds maximum length
-
validateSku
Validates SKU does not exceed maximum length.- Parameters:
sku-- Returns:
- the validated SKU
- Throws:
IllegalArgumentException- if SKU exceeds maximum length
-
validatePeriodCount
Validates periodCount is not null and between `MIN_PERIOD` and `MAX_PERIOD` inclusive.- Parameters:
periodCount-- Throws:
IllegalArgumentException- if periodCount is null or out of range
-
validateItems
Validates a list of items is not null, not empty, and contains no null elements.- Type Parameters:
T- the type of items in the list, must extend AbstractAdvancedCommerceItem- Parameters:
list- the list of items to validate- Returns:
- the validated list of items
- Throws:
IllegalArgumentException- if the list is null, empty, or contains null elements
-