Class TemporalObjects


  • public final class TemporalObjects
    extends java.lang.Object
    Utilities for the creation of Java 8 Time objects.
    Since:
    3.1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      TemporalObjects()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.time.format.DateTimeFormatter formatterFor​(java.lang.Object target, java.util.Locale locale)  
      private static boolean shouldDisplayYearBeforeMonth​(java.util.Locale locale)  
      static java.time.temporal.TemporalAccessor temporal​(java.lang.Object target)  
      private static java.time.format.DateTimeFormatter yearMonthFormatter​(java.util.Locale locale)  
      static java.time.chrono.ChronoZonedDateTime zonedTime​(java.lang.Object target, java.time.ZoneId defaultZoneId)
      Creates a Temporal object filling the missing fields of the provided time with default values.
      • Methods inherited from class java.lang.Object

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

      • TemporalObjects

        public TemporalObjects()
    • Method Detail

      • formatterFor

        public static java.time.format.DateTimeFormatter formatterFor​(java.lang.Object target,
                                                                      java.util.Locale locale)
      • zonedTime

        public static java.time.chrono.ChronoZonedDateTime zonedTime​(java.lang.Object target,
                                                                     java.time.ZoneId defaultZoneId)
        Creates a Temporal object filling the missing fields of the provided time with default values.
        Parameters:
        target - the temporal object to be converted
        defaultZoneId - the default value for ZoneId
        Returns:
        a Temporal object
      • temporal

        public static java.time.temporal.TemporalAccessor temporal​(java.lang.Object target)
      • yearMonthFormatter

        private static java.time.format.DateTimeFormatter yearMonthFormatter​(java.util.Locale locale)
      • shouldDisplayYearBeforeMonth

        private static boolean shouldDisplayYearBeforeMonth​(java.util.Locale locale)