Interface ServiceUtils

All Known Implementing Classes:
DefaultServiceUtils

public interface ServiceUtils
REST Service Utility Class
  • Method Details

    • convertGuidToBase64

      String convertGuidToBase64(String cartGuid) throws org.apache.commons.codec.DecoderException
      Converts the GUid from a CartModel to an Base64 encoded GUid
      Parameters:
      cartGuid -
      Throws:
      org.apache.commons.codec.DecoderException
    • addLeadingZeros

      String addLeadingZeros(String productCode)
      Adds the Leading zeros to Product Code
      Parameters:
      productCode -
      Returns:
      product Code with leading Zeros
    • formatStringtoInt

      Integer formatStringtoInt(String str)
      It converts a String to an Integer
      Parameters:
      str - String which represents a number
      Returns:
      Integer representation of the String
    • logMessageResponseAndCheckMessageType

      boolean logMessageResponseAndCheckMessageType(org.apache.log4j.Logger logger, MessagesList messages)
      Checks if the response messages has errors and logs the message
      Parameters:
      logger -
      messages -
      Returns:
      true if the response contains error messages
    • parseStringToDate

      Date parseStringToDate(String dateAsString)
      Converts a date string into a date object
      Parameters:
      dateAsString -
      Returns:
      converted date
    • formatDateToString

      String formatDateToString(Date date)
      Converts a date into a date string
      Parameters:
      date -
      Returns:
      converted date as string
    • removeLeadingZeros

      String removeLeadingZeros(String productCode)
      Removes the leading zeros from the product code
      Parameters:
      productCode -
      Returns:
      product Code without leading Zeros
    • createExternalIdForItem

      String createExternalIdForItem(String itemNo, String guid)
      Parameters:
      itemNo -
      guid -
      Returns:
      externalId
    • extractItemIdFromExternalId

      String extractItemIdFromExternalId(String externalId)
      Parameters:
      externalId -
      Returns:
      itemId