Package com.tyndalehouse.step.core.utils
Class ConversionUtils
java.lang.Object
com.tyndalehouse.step.core.utils.ConversionUtils
Utilities to convert from one form to another
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.joda.time.LocalDateTimestatic intgetValidInt(String integer, int fallback) Attempts to parse an integer, and return that value if successful, otherwise returns the fallback valuestatic longlocalDateTimeToEpochMinutes(org.joda.time.LocalDateTime dateTime) static longstringToEpochMinutes(String value)
-
Method Details
-
localDateTimeToEpochMinutes
public static long localDateTimeToEpochMinutes(org.joda.time.LocalDateTime dateTime) - Parameters:
dateTime- the date time- Returns:
- the number of minutes since epoch
-
stringToEpochMinutes
- Parameters:
value- the date time- Returns:
- the number of minutes since epoch
-
epochMinutesStringToLocalDateTime
- Parameters:
value- the value of the date- Returns:
- the equivalent local date time
-
getValidInt
Attempts to parse an integer, and return that value if successful, otherwise returns the fallback value- Parameters:
integer- the integer valuefallback- the fallback value- Returns:
- the integer, whether parsed or fallback.
-