Interface ServiceUtils
- All Known Implementing Classes:
DefaultServiceUtils
public interface ServiceUtils
REST Service Utility Class
-
Method Summary
Modifier and TypeMethodDescriptionaddLeadingZeros(String productCode) Adds the Leading zeros to Product CodeconvertGuidToBase64(String cartGuid) Converts the GUid from a CartModel to an Base64 encoded GUidcreateExternalIdForItem(String itemNo, String guid) extractItemIdFromExternalId(String externalId) formatDateToString(Date date) Converts a date into a date stringformatStringtoInt(String str) It converts a String to an IntegerbooleanlogMessageResponseAndCheckMessageType(org.apache.log4j.Logger logger, MessagesList messages) Checks if the response messages has errors and logs the messageparseStringToDate(String dateAsString) Converts a date string into a date objectremoveLeadingZeros(String productCode) Removes the leading zeros from the product code
-
Method Details
-
convertGuidToBase64
Converts the GUid from a CartModel to an Base64 encoded GUid- Parameters:
cartGuid-- Throws:
org.apache.commons.codec.DecoderException
-
addLeadingZeros
Adds the Leading zeros to Product Code- Parameters:
productCode-- Returns:
- product Code with leading Zeros
-
formatStringtoInt
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
Converts a date string into a date object- Parameters:
dateAsString-- Returns:
- converted date
-
formatDateToString
Converts a date into a date string- Parameters:
date-- Returns:
- converted date as string
-
removeLeadingZeros
Removes the leading zeros from the product code- Parameters:
productCode-- Returns:
- product Code without leading Zeros
-
createExternalIdForItem
- Parameters:
itemNo-guid-- Returns:
- externalId
-
extractItemIdFromExternalId
- Parameters:
externalId-- Returns:
- itemId
-