test_class.declarator: logger = LoggerFactory.getLogger(DateTimeUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(DateTimeUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/DateTimeUtilTest.java
test_class.identifier: DateTimeUtilTest
test_case.body: @Test
      public void parseEmbedded() throws Exception {
  
          // parse just dates
          DateTime dt0 = DateTimeUtil.parseEmbedded("app-2009-06-24.log.gz", "yyyy-MM-dd", DateTimeZone.UTC);
          logger.debug("dt = " + dt0);
          Assert.assertEquals(new DateTime(2009,6,24,0,0,0,0,DateTimeZone.UTC), dt0);
  
          // parse a date and time
          dt0 = DateTimeUtil.parseEmbedded("app-2009-06-24-051112.log.gz", "yyyy-MM-dd-hhmmss", DateTimeZone.UTC);
          logger.debug("dt = " + dt0);
          Assert.assertEquals(new DateTime(2009,6,24,5,11,12,0,DateTimeZone.UTC), dt0);
  
          // parse different date format
          dt0 = DateTimeUtil.parseEmbedded("app-20090624-051112.log.gz", "yyyyMMdd-hhmmss", DateTimeZone.UTC);
          logger.debug("dt = " + dt0);
          Assert.assertEquals(new DateTime(2009,6,24,5,11,12,0,DateTimeZone.UTC), dt0);
  
          // parse just year and month
          dt0 = DateTimeUtil.parseEmbedded("app-200906.log.gz", "yyyyMM", DateTimeZone.UTC);
          logger.debug("dt = " + dt0);
          Assert.assertEquals(new DateTime(2009,6,1,0,0,0,0,DateTimeZone.UTC), dt0);
  
          try {
              // filename is missing a day
              dt0 = DateTimeUtil.parseEmbedded("app-200906.log.gz", "yyyyMMdd", DateTimeZone.UTC);
              Assert.fail("parse should have failed");
          } catch (IllegalArgumentException e) {
              // correct behavior
          }
  
          try {
              // june only has 30 days
              dt0 = DateTimeUtil.parseEmbedded("app-20090631.log.gz", "yyyyMMdd", DateTimeZone.UTC);
              Assert.fail("parse should have failed");
          } catch (IllegalArgumentException e) {
              // correct behavior
          }
  
          try {
              // tt isn't a valid pattern
              dt0 = DateTimeUtil.parseEmbedded("app-20090631.log.gz", "yyyyMMtt", DateTimeZone.UTC);
              Assert.fail("parse should have failed");
          } catch (IllegalArgumentException e) {
              // correct behavior
          }
      }
test_case.class_method_signature: DateTimeUtilTest.parseEmbedded()
test_case.full_signature: @Test public void parseEmbedded()
test_case.identifier: parseEmbedded
test_case.invocations: parseEmbedded debug assertEquals parseEmbedded debug assertEquals parseEmbedded debug assertEquals parseEmbedded debug assertEquals parseEmbedded fail parseEmbedded fail parseEmbedded fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parseEmbedded()
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/DateTimeUtil.java
focal_class.identifier: DateTimeUtil
focal_class.class_method_signature: DateTimeUtil.toDateTime(Timestamp value)
focal_class.full_signature: public static DateTime toDateTime(Timestamp value)
focal_class.identifier: toDateTime
focal_class.modifiers: public static
focal_class.parameters: (Timestamp value)
focal_class.return: DateTime
focal_class.signature: DateTime toDateTime(Timestamp value)
focal_class.class_method_signature: DateTimeUtil.copy(DateTime value)
focal_class.full_signature: public static DateTime copy(DateTime value)
focal_class.identifier: copy
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime copy(DateTime value)
focal_class.class_method_signature: DateTimeUtil.toTimestamp(DateTime dt)
focal_class.full_signature: public static Timestamp toTimestamp(DateTime dt)
focal_class.identifier: toTimestamp
focal_class.modifiers: public static
focal_class.parameters: (DateTime dt)
focal_class.return: Timestamp
focal_class.signature: Timestamp toTimestamp(DateTime dt)
focal_class.class_method_signature: DateTimeUtil.now()
focal_class.full_signature: public static DateTime now()
focal_class.identifier: now
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: DateTime
focal_class.signature: DateTime now()
focal_class.class_method_signature: DateTimeUtil.parseEmbedded(String string0)
focal_class.full_signature: public static DateTime parseEmbedded(String string0)
focal_class.identifier: parseEmbedded
focal_class.modifiers: public static
focal_class.parameters: (String string0)
focal_class.return: DateTime
focal_class.signature: DateTime parseEmbedded(String string0)
focal_class.class_method_signature: DateTimeUtil.parseEmbedded(String string0, String pattern, DateTimeZone zone)
focal_class.full_signature: public static DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone)
focal_class.identifier: parseEmbedded
focal_class.modifiers: public static
focal_class.parameters: (String string0, String pattern, DateTimeZone zone)
focal_class.return: DateTime
focal_class.signature: DateTime parseEmbedded(String string0, String pattern, DateTimeZone zone)
focal_class.class_method_signature: DateTimeUtil.floorToYear(DateTime value)
focal_class.full_signature: public static DateTime floorToYear(DateTime value)
focal_class.identifier: floorToYear
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToYear(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToMonth(DateTime value)
focal_class.full_signature: public static DateTime floorToMonth(DateTime value)
focal_class.identifier: floorToMonth
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToMonth(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToDay(DateTime value)
focal_class.full_signature: public static DateTime floorToDay(DateTime value)
focal_class.identifier: floorToDay
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToDay(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToHour(DateTime value)
focal_class.full_signature: public static DateTime floorToHour(DateTime value)
focal_class.identifier: floorToHour
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToHour(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToHalfHour(DateTime value)
focal_class.full_signature: public static DateTime floorToHalfHour(DateTime value)
focal_class.identifier: floorToHalfHour
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToHalfHour(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToQuarterHour(DateTime value)
focal_class.full_signature: public static DateTime floorToQuarterHour(DateTime value)
focal_class.identifier: floorToQuarterHour
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToQuarterHour(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToTenMinutes(DateTime value)
focal_class.full_signature: public static DateTime floorToTenMinutes(DateTime value)
focal_class.identifier: floorToTenMinutes
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToTenMinutes(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToFiveMinutes(DateTime value)
focal_class.full_signature: public static DateTime floorToFiveMinutes(DateTime value)
focal_class.identifier: floorToFiveMinutes
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToFiveMinutes(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToMinutePeriod(DateTime value, int periodInMinutes)
focal_class.full_signature: public static DateTime floorToMinutePeriod(DateTime value, int periodInMinutes)
focal_class.identifier: floorToMinutePeriod
focal_class.modifiers: public static
focal_class.parameters: (DateTime value, int periodInMinutes)
focal_class.return: DateTime
focal_class.signature: DateTime floorToMinutePeriod(DateTime value, int periodInMinutes)
focal_class.class_method_signature: DateTimeUtil.floorToMinute(DateTime value)
focal_class.full_signature: public static DateTime floorToMinute(DateTime value)
focal_class.identifier: floorToMinute
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToMinute(DateTime value)
focal_class.class_method_signature: DateTimeUtil.floorToSecond(DateTime value)
focal_class.full_signature: public static DateTime floorToSecond(DateTime value)
focal_class.identifier: floorToSecond
focal_class.modifiers: public static
focal_class.parameters: (DateTime value)
focal_class.return: DateTime
focal_class.signature: DateTime floorToSecond(DateTime value)
focal_method.body: public static DateTime parseEmbedded(String string0) throws IllegalArgumentException {
          return parseEmbedded(string0, "yyyy-MM-dd", DateTimeZone.UTC);
      }
focal_method.class_method_signature: DateTimeUtil.parseEmbedded(String string0)
focal_method.full_signature: public static DateTime parseEmbedded(String string0)
focal_method.identifier: parseEmbedded
focal_method.invocations: parseEmbedded
focal_method.modifiers: public static
focal_method.parameters: (String string0)
focal_method.return: DateTime
focal_method.signature: DateTime parseEmbedded(String string0)