Class TimeAdapter

java.lang.Object
org.keycloak.models.map.common.TimeAdapter

public class TimeAdapter extends Object
Wrapper for adapters around handling time in seconds. Will be removed once #11053 has been implemented.
Author:
Alexander Schwartz
  • Constructor Details

    • TimeAdapter

      public TimeAdapter()
  • Method Details

    • fromLongWithTimeInSecondsToIntegerWithTimeInSeconds

      public static int fromLongWithTimeInSecondsToIntegerWithTimeInSeconds(Long timestamp)
      Wrapper to all unsafe downgrading from a Long to an Integer while Keycloak core still handles all time since 1970 as seconds as integers. This is safer to use than downgrading in several places as that might be missed once the Core starts to use longs as timestamps as well. Simplify/remove once #11053 has been implemented.
    • fromIntegerWithTimeInSecondsToLongWithTimeAsInSeconds

      public static long fromIntegerWithTimeInSecondsToLongWithTimeAsInSeconds(int timestamp)
      Wrapper to all upgrading from an Integer to a Long while Keycloak core still handles all time seconds since 1970 as seconds as integers. This is safer to use and remove once the Core starts to use longs as timestamps as well. Simplify/remove once #11053 has been implemented.
    • fromSecondsToMilliseconds

      public static Long fromSecondsToMilliseconds(Long seconds)
    • fromMilliSecondsToSeconds

      public static Long fromMilliSecondsToSeconds(Long milliSeconds)
    • fromSecondsToMilliseconds

      public static Long fromSecondsToMilliseconds(int seconds)