Examples of FudgeDateTime


Examples of org.fudgemsg.types.FudgeDateTime

    if (accuracy == null) {
      accuracy = ExpiryAccuracy.DAY_MONTH_YEAR;
    }
    switch (accuracy) {
      case MIN_HOUR_DAY_MONTH_YEAR:
        return new FudgeDateTime(DateTimeAccuracy.MINUTE, object.getExpiry().toOffsetDateTime());
      case HOUR_DAY_MONTH_YEAR:
        return new FudgeDateTime(DateTimeAccuracy.HOUR, object.getExpiry().toOffsetDateTime());
      case DAY_MONTH_YEAR:
        return new FudgeDateTime(FudgeDate.from(object.getExpiry()), new FudgeTime(DateTimeAccuracy.DAY, 0, 0, 0));
      case MONTH_YEAR:
        return new FudgeDateTime(FudgeDate.ofYearMonth(object.getExpiry().getYear(), object.getExpiry().getMonthValue()), new FudgeTime(DateTimeAccuracy.MONTH, 0, 0, 0));
      case YEAR:
        return new FudgeDateTime(FudgeDate.ofYear(object.getExpiry().getYear()), new FudgeTime(DateTimeAccuracy.YEAR, 0, 0, 0));
      default:
        throw new IllegalArgumentException("Invalid accuracy value on " + object);
    }
  }
View Full Code Here

Examples of org.fudgemsg.types.FudgeDateTime

      return null;
    }
    final ZoneId zone = msg.getValue(ZoneId.class, ZONE_FIELD_NAME);
    final Object obj = msg.getValue(DATETIME_FIELD_NAME);
    if (obj instanceof FudgeDateTime) {
      FudgeDateTime fudge = (FudgeDateTime) obj;
      if (fudge.getTime().hasTimezoneOffset()) {
        OffsetDateTime odt = fudge.toOffsetDateTime();
        if (zone != null) {
          return FlexiDateTime.of(odt.atZoneSameInstant(zone));
        }
        return FlexiDateTime.of(odt);
      } else {
        return FlexiDateTime.of(fudge.toLocalDateTime());
      }
    } else if (obj instanceof FudgeDate) {
      FudgeDate fudge = (FudgeDate) obj;
      return FlexiDateTime.of(fudge.toLocalDate());
    } else if (obj instanceof OffsetDateTime) {
      OffsetDateTime odt = (OffsetDateTime) obj;
      if (zone != null) {
        return FlexiDateTime.of(odt.atZoneSameInstant(zone));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.