-
Notifications
You must be signed in to change notification settings - Fork 4
MathConverterUtils
The MathConverterUtils class provides a set of methods for converting common units and handling date formats. This utility supports conversions such as inches to centimeters, Celsius to Fahrenheit, and string to date, enabling ease of use when working with measurements and date representations.
-
inchesToCentimeters(double)
Converts a given length from inches to centimeters.double centimeters = MathConverterUtils.inchesToCentimeters(5.0);
-
centimetersToInches(double)
Converts a given length from centimeters to inches.double inches = MathConverterUtils.centimetersToInches(12.7);
-
celsiusToFahrenheit(double)
Converts a temperature from Celsius to Fahrenheit.double fahrenheit = MathConverterUtils.celsiusToFahrenheit(25.0);
-
fahrenheitToCelsius(double)
Converts a temperature from Fahrenheit to Celsius.double celsius = MathConverterUtils.fahrenheitToCelsius(77.0);
-
kilometersToMiles(double)
Converts a distance from kilometers to miles.double miles = MathConverterUtils.kilometersToMiles(10.0);
-
milesToKilometers(double)
Converts a distance from miles to kilometers.double kilometers = MathConverterUtils.milesToKilometers(6.2);
-
stringToDate(String, String)
Converts a date in string format to aDateobject based on a specified format.Date date = MathConverterUtils.stringToDate("2023-10-30", "yyyy-MM-dd");
-
dateToString(Date, String)
Converts aDateobject to a string format based on a specified pattern.String dateStr = MathConverterUtils.dateToString(date, "yyyy-MM-dd");
-
Error Handling: Conversion errors are logged with
BaseLoggerat theERRORlevel. For instance, if a date string cannot be parsed, an error log is generated. - Utility Design: This class cannot be instantiated, as it contains a private constructor and only static methods.
Variant Loader
Data Pipeline
Network & Packets
Logging
Markdown
Utility Classes
- Conversion
- Math
- Minecraft
- Schedular