Class DefaultServiceUtils
java.lang.Object
com.sap.retail.oaa.commerce.services.common.util.impl.DefaultServiceUtils
- All Implemented Interfaces:
ServiceUtils
REST Service Utility Class
-
Constructor Summary
Constructors -
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 codevoidsetDateFormat(String dateFormat) voidsetLeadingZeroFormatter(String leadingZeroFormatter) voidsetTimeZone(String timeZone)
-
Constructor Details
-
DefaultServiceUtils
public DefaultServiceUtils()
-
-
Method Details
-
convertGuidToBase64
Description copied from interface:ServiceUtilsConverts the GUid from a CartModel to an Base64 encoded GUid- Specified by:
convertGuidToBase64in interfaceServiceUtils- Throws:
org.apache.commons.codec.DecoderException
-
addLeadingZeros
Description copied from interface:ServiceUtilsAdds the Leading zeros to Product Code- Specified by:
addLeadingZerosin interfaceServiceUtils- Returns:
- product Code with leading Zeros
-
formatStringtoInt
Description copied from interface:ServiceUtilsIt converts a String to an Integer- Specified by:
formatStringtoIntin interfaceServiceUtils- Parameters:
str- String which represents a number- Returns:
- Integer representation of the String
-
logMessageResponseAndCheckMessageType
public boolean logMessageResponseAndCheckMessageType(org.apache.log4j.Logger logger, MessagesList messages) Description copied from interface:ServiceUtilsChecks if the response messages has errors and logs the message- Specified by:
logMessageResponseAndCheckMessageTypein interfaceServiceUtils- Returns:
- true if the response contains error messages
-
parseStringToDate
Description copied from interface:ServiceUtilsConverts a date string into a date object- Specified by:
parseStringToDatein interfaceServiceUtils- Returns:
- converted date
-
removeLeadingZeros
Description copied from interface:ServiceUtilsRemoves the leading zeros from the product code- Specified by:
removeLeadingZerosin interfaceServiceUtils- Returns:
- product Code without leading Zeros
-
formatDateToString
Description copied from interface:ServiceUtilsConverts a date into a date string- Specified by:
formatDateToStringin interfaceServiceUtils- Returns:
- converted date as string
-
setDateFormat
- Parameters:
dateFormat-
-
setTimeZone
- Parameters:
timeZone-
-
setLeadingZeroFormatter
- Parameters:
leadingZeroFormatter- the leadingZeroFormatter to set
-
createExternalIdForItem
- Specified by:
createExternalIdForItemin interfaceServiceUtils- Parameters:
itemNo-guid-- Returns:
- String
-
extractItemIdFromExternalId
- Specified by:
extractItemIdFromExternalIdin interfaceServiceUtils- Returns:
- itemId
-