Class HelperValidationUtils

java.lang.Object
com.apple.itunes.storekit.model.HelperValidationUtils

public final class HelperValidationUtils extends Object
  • 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

      public static String validateDescription(String description)
      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

      public static String validateDisplayName(String displayName)
      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

      public static String validateSku(String sku)
      Validates SKU does not exceed maximum length.
      Parameters:
      sku -
      Returns:
      the validated SKU
      Throws:
      IllegalArgumentException - if SKU exceeds maximum length
    • validatePeriodCount

      public static Integer validatePeriodCount(Integer periodCount)
      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

      public 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.
      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