Class ObjectConverter
java.lang.Object
de.hybris.platform.adaptivesearch.util.ObjectConverter
Provides methods for generic object conversion.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbigDecimalToString(BigDecimal value) Converts fromBigDecimaltoString.static StringbigIntegerToString(BigInteger value) Converts fromBigIntegertoString.static StringbooleanToString(Boolean value) static <T> TConverts a value to the given target class.static StringdateToString(Date value) static StringdoubleToString(Double value) static StringfloatToString(Float value) protected static StringgenerateConverterKey(Class<?> sourceClass, Class<?> targetClass) static StringintegerToString(Integer value) static StringlongToString(Long value) static StringshortToString(Short value) static BigDecimalstringToBigDecimal(String value) Converts fromStringtoBigDecimal.static BigIntegerstringToBigInteger(String value) Converts fromStringtoBigInteger.static BooleanstringToBoolean(String value) static DatestringToDate(String value) static DoublestringToDouble(String value) static FloatstringToFloat(String value) static IntegerstringToInteger(String value) static LongstringToLong(String value) static ShortstringToShort(String value)
-
Field Details
-
DATE_PATTERN
- See Also:
-
-
Method Details
-
generateConverterKey
-
convert
Converts a value to the given target class.- Parameters:
value- - the valuetargetClass- - the target class- Returns:
- the converted value
- Throws:
AsException- - if an error occurs during the conversion
-
booleanToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToBoolean
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
shortToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToShort
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
integerToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToInteger
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
longToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToLong
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
floatToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToFloat
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
doubleToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToDouble
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
bigIntegerToString
Converts fromBigIntegertoString.- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToBigInteger
Converts fromStringtoBigInteger.- Parameters:
value- - the value to convert- Returns:
- the converted value
-
bigDecimalToString
Converts fromBigDecimaltoString.- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToBigDecimal
Converts fromStringtoBigDecimal.- Parameters:
value- - the value to convert- Returns:
- the converted value
-
dateToString
- Parameters:
value- - the value to convert- Returns:
- the converted value
-
stringToDate
- Parameters:
value- - the value to convert- Returns:
- the converted value
-