Object MathUtils.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer safeLongToInt(Long numLong) Convert long to int safely.
      final Long convertToEpochInMS(Long epoch) Convert to epoch timestamp in Milli-seconds
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • safeLongToInt

         final Integer safeLongToInt(Long numLong)

        Convert long to int safely. Similar with Math.toIntExact() in Java 8.

        Parameters:
        numLong - Number of type long to convert.
      • convertToEpochInMS

         final Long convertToEpochInMS(Long epoch)

        Convert to epoch timestamp in Milli-seconds

        Parameters:
        epoch - epoch in second or milli-second format