Class ConversionTools
java.lang.Object
de.hybris.platform.sap.sapproductavailability.converter.ConversionTools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddLeadingZerosToNumericID(String inputString, int desiredLength) Method adds leading zeros to a numeric string based on a specified total lengthprotected StringconvertProductCode(String ProductCode) Converted the product code to the internal format.static LongconvertQuantityToNumber(String quantity) Since the format of the quantity is xxx,yyy we need to reparse the string.
-
Constructor Details
-
ConversionTools
public ConversionTools()
-
-
Method Details
-
addLeadingZerosToNumericID
Method adds leading zeros to a numeric string based on a specified total length- Parameters:
inputString- contains the numeric StringdesiredLength- specifies the total desired length of the string- Returns:
- String with leading zeroes appended
-
convertQuantityToNumber
Since the format of the quantity is xxx,yyy we need to reparse the string. Format of quantity: [+|-][0123456789]{1,13}\{DecimalPoint}[0123456789]{3} DecimalPoint: {.|,} depending on Locale. -
convertProductCode
Converted the product code to the internal format. For numeric product ID, add leading zeros so that the length of the product ID becomes 18 decimal digits. For non-numeric product ID, do not do any change.- Parameters:
ProductCode-- Returns:
- Formatted product code
-