Examples of toOffsetDateTime()


Examples of org.fudgemsg.types.FudgeDateTime.toOffsetDateTime()

    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 {
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

   * @return the best representation, not null
   */
  public Temporal toBest() {
    if (_zone != null) {
      ZonedDateTime zdt = _date.atTime(_time).atZone(_zone);
      return (_zone instanceof ZoneOffset ? zdt.toOffsetDateTime() : zdt);
    } else if (_time != null) {
      return LocalDateTime.of(_date, _time);
    }
    return _date;
  }
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

      for (int i = 0; i < _securities.length; i++) {
        final BigDecimal n = new BigDecimal(_amounts[i]);
        final GovernmentBondSecurity bond = _securities[i];
        final ZonedDateTime tradeDate = bond.getSettlementDate();
        final ManageableTrade trade = new ManageableTrade(n, getSecurityPersister().storeSecurity(bond), tradeDate.toLocalDate(),
            tradeDate.toOffsetDateTime().toOffsetTime(), ExternalId.of(Counterparty.DEFAULT_SCHEME, COUNTERPARTY));
        trade.setPremium(bond.getIssuancePrice());
        trade.setPremiumCurrency(bond.getCurrency());
        final Position position = SimplePositionGenerator.createPositionFromTrade(trade);
        node.addPosition(position);
      }
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

      @Override
      public ManageableTrade createSecurityTrade(QuantityGenerator quantityGenerator, SecurityPersister securityPersister, NameGenerator counterPartyGenerator) {
        ManageableTrade trade = null;
        RawSecurity security = createSecurity();
        ZonedDateTime tradeDate = ZonedDateTime.now();
        trade = new ManageableTrade(quantityGenerator.createQuantity(), securityPersister.storeSecurity(security), tradeDate.toLocalDate(), tradeDate.toOffsetDateTime().toOffsetTime(),
            ExternalId.of(Counterparty.DEFAULT_SCHEME, counterPartyGenerator.createName()));
        return trade;
      }
     
    }, new InMemorySecurityPersister(source));
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

            trade.setPremiumDate(premiumDate);
            if (tradeJson.has("premiumTime")) {
              LocalTime premiumTime = LocalTime.parse(tradeJson.getString("premiumTime"));
              ZoneOffset premiumOffset = getOffset(tradeJson, "premiumOffset");
              ZonedDateTime zonedDateTime = premiumDate.atTime(premiumTime).atZone(premiumOffset);
              trade.setPremiumTime(zonedDateTime.toOffsetDateTime().toOffsetTime());
            }
          }
          if (tradeJson.has("quantity")) {
            trade.setQuantity(new BigDecimal(tradeJson.getString("quantity")));
          }
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

            trade.setTradeDate(tradeDate);
            if (tradeJson.has("tradeTime")) {
              LocalTime tradeTime = LocalTime.parse(tradeJson.getString("tradeTime"));
              ZoneOffset tradeOffset = getOffset(tradeJson, "tradeOffset");
              ZonedDateTime zonedDateTime = tradeDate.atTime(tradeTime).atZone(tradeOffset);
              trade.setTradeTime(zonedDateTime.toOffsetDateTime().toOffsetTime());
            }   
          }
          addTradeAttributes(trade, tradeJson);
          trades.add(trade);
        }
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.toOffsetDateTime()

  public ManageableTrade createSecurityTrade(final QuantityGenerator quantityGenerator, final SecurityPersister securityPersister, final NameGenerator counterPartyGenerator) {
    ManageableTrade trade = null;
    final T security = createSecurity();
    if (security != null) {
      final ZonedDateTime tradeDate = previousWorkingDay(ZonedDateTime.now().minusDays(getRandom(30)), getRandomCurrency());
      trade = new ManageableTrade(quantityGenerator.createQuantity(), securityPersister.storeSecurity(security), tradeDate.toLocalDate(), tradeDate.toOffsetDateTime().toOffsetTime(),
          ExternalId.of(Counterparty.DEFAULT_SCHEME, counterPartyGenerator.createName()));
    }
    return trade;
  }
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.