java.lang.Object
records.util.Convert
Utility class for converting between different data types and formats.
Available methods:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDateDateToLocalDate(Date date) Converts a java.util.Date object to java.time.LocalDate.static StringdoubleToString(Double value) Converts a Double value to a string with two decimal places.static StringMonthValueToString(int value) Converts a month value to a string with two digits.static doubleroundToTwoDecimalPlaces(double value) Rounds a double value to two decimal places.static DoubleStringToDouble(String value) Converts a string to a Double value.static LocalDateConverts a string in "yyyy-MM-dd" format to LocalDate.static LocalTimeStringToLocalTime(String time) Converts a string representing time to LocalTime.
-
Constructor Details
-
Convert
public Convert()
-
-
Method Details
-
DateToLocalDate
Converts a java.util.Date object to java.time.LocalDate.- Parameters:
date- the Date object to convert- Returns:
- the corresponding LocalDate object
-
StringToLocalDate_yyyyMMdd
Converts a string in "yyyy-MM-dd" format to LocalDate.- Parameters:
date- the string representing the date- Returns:
- the corresponding LocalDate object
-
StringToLocalTime
Converts a string representing time to LocalTime.- Parameters:
time- the string representing the time- Returns:
- the corresponding LocalTime object
-
doubleToString
Converts a Double value to a string with two decimal places.- Parameters:
value- the Double value to convert- Returns:
- the formatted string
-
StringToDouble
Converts a string to a Double value.- Parameters:
value- the string to convert- Returns:
- the corresponding Double value
-
MonthValueToString
Converts a month value to a string with two digits.- Parameters:
value- the month value to convert- Returns:
- the formatted string
-
roundToTwoDecimalPlaces
public static double roundToTwoDecimalPlaces(double value) Rounds a double value to two decimal places.- Parameters:
value- the value to round- Returns:
- the rounded value
-