Class ConversionUtils

java.lang.Object
com.tyndalehouse.step.core.utils.ConversionUtils

public final class ConversionUtils extends Object
Utilities to convert from one form to another
  • 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

      public static long stringToEpochMinutes(String value)
      Parameters:
      value - the date time
      Returns:
      the number of minutes since epoch
    • epochMinutesStringToLocalDateTime

      public static org.joda.time.LocalDateTime epochMinutesStringToLocalDateTime(String value)
      Parameters:
      value - the value of the date
      Returns:
      the equivalent local date time
    • getValidInt

      public static int getValidInt(String integer, int fallback)
      Attempts to parse an integer, and return that value if successful, otherwise returns the fallback value
      Parameters:
      integer - the integer value
      fallback - the fallback value
      Returns:
      the integer, whether parsed or fallback.