Class ConversionTools
- java.lang.Object
-
- de.hybris.platform.sap.sapproductavailability.converter.ConversionTools
-
public class ConversionTools extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ConversionTools()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringaddLeadingZerosToNumericID(java.lang.String inputString, int desiredLength)Method adds leading zeros to a numeric string based on a specified total lengthprotected java.lang.StringconvertProductCode(java.lang.String ProductCode)Converted the product code to the internal format.static java.lang.LongconvertQuantityToNumber(java.lang.String quantity)Since the format of the quantity is xxx,yyy we need to reparse the string.
-
-
-
Method Detail
-
addLeadingZerosToNumericID
public static java.lang.String addLeadingZerosToNumericID(java.lang.String inputString, int desiredLength)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
public static java.lang.Long convertQuantityToNumber(java.lang.String quantity)
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
protected java.lang.String convertProductCode(java.lang.String ProductCode)
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
-
-