congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AdjustableDate.getAdjustment
Code IndexAdd Tabnine to your IDE (free)

How to use
getAdjustment
method
in
com.opengamma.strata.basics.date.AdjustableDate

Best Java code snippets using com.opengamma.strata.basics.date.AdjustableDate.getAdjustment (Showing top 8 results out of 315)

origin: OpenGamma/Strata

@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
 switch (propertyName.hashCode()) {
  case 482476551:  // unadjusted
   return ((AdjustableDate) bean).getUnadjusted();
  case 1977085293:  // adjustment
   return ((AdjustableDate) bean).getAdjustment();
 }
 return super.propertyGet(bean, propertyName, quiet);
}
origin: OpenGamma/Strata

public void test_of_1arg() {
 AdjustableDate test = AdjustableDate.of(FRI_2014_07_11);
 assertEquals(test.getUnadjusted(), FRI_2014_07_11);
 assertEquals(test.getAdjustment(), BDA_NONE);
 assertEquals(test.toString(), "2014-07-11");
 assertEquals(test.adjusted(REF_DATA), FRI_2014_07_11);
}
origin: OpenGamma/Strata

public void test_of_2args_withNoAdjustment() {
 AdjustableDate test = AdjustableDate.of(FRI_2014_07_11, BDA_NONE);
 assertEquals(test.getUnadjusted(), FRI_2014_07_11);
 assertEquals(test.getAdjustment(), BDA_NONE);
 assertEquals(test.toString(), "2014-07-11");
 assertEquals(test.adjusted(REF_DATA), FRI_2014_07_11);
}
origin: OpenGamma/Strata

public void test_of_2args_withAdjustment() {
 AdjustableDate test = AdjustableDate.of(FRI_2014_07_11, BDA_FOLLOW_SAT_SUN);
 assertEquals(test.getUnadjusted(), FRI_2014_07_11);
 assertEquals(test.getAdjustment(), BDA_FOLLOW_SAT_SUN);
 assertEquals(test.toString(), "2014-07-11 adjusted by Following using calendar Sat/Sun");
 assertEquals(test.adjusted(REF_DATA), FRI_2014_07_11);
}
origin: OpenGamma/Strata

private void assertFra(List<Trade> trades, boolean interpolatedParty1) {
 assertEquals(trades.size(), 1);
 Trade trade = trades.get(0);
 assertEquals(trade.getClass(), FraTrade.class);
 FraTrade fraTrade = (FraTrade) trade;
 assertEquals(fraTrade.getInfo().getTradeDate(), Optional.of(date(1991, 5, 14)));
 StandardId party1id = StandardId.of("http://www.hsbc.com/swaps/trade-id", "MB87623");
 StandardId party2id = StandardId.of("http://www.abnamro.com/swaps/trade-id", "AA9876");
 assertEquals(fraTrade.getInfo().getId(), Optional.of(interpolatedParty1 ? party1id : party2id));
 Fra fra = fraTrade.getProduct();
 assertEquals(fra.getBuySell(), interpolatedParty1 ? BUY : SELL);
 assertEquals(fra.getStartDate(), date(1991, 7, 17));
 assertEquals(fra.getEndDate(), date(1992, 1, 17));
 assertEquals(fra.getBusinessDayAdjustment(), Optional.empty());
 assertEquals(fra.getPaymentDate().getUnadjusted(), date(1991, 7, 17));
 assertEquals(fra.getPaymentDate().getAdjustment(), BusinessDayAdjustment.of(FOLLOWING, CHZU));
 assertEquals(fra.getFixingDateOffset().getDays(), -2);
 assertEquals(fra.getFixingDateOffset().getCalendar(), GBLO);
 assertEquals(fra.getFixingDateOffset().getAdjustment(), BusinessDayAdjustment.NONE);
 assertEquals(fra.getDayCount(), ACT_360);
 assertEquals(fra.getCurrency(), CHF);
 assertEquals(fra.getNotional(), 25000000d);
 assertEquals(fra.getFixedRate(), 0.04d);
 assertEquals(fra.getIndex(), interpolatedParty1 ? CHF_LIBOR_3M : CHF_LIBOR_6M);
 assertEquals(fra.getIndexInterpolated(), interpolatedParty1 ? Optional.of(CHF_LIBOR_6M) : Optional.empty());
 assertEquals(fra.getDiscounting(), FraDiscountingMethod.ISDA);
}
origin: OpenGamma/Strata

  .orElseGet(() -> document.parseAdjustedRelativeDateOffset(calcPeriodDatesEl.getChild("relativeEffectiveDate")));
accrualScheduleBuilder.startDate(startDate.getUnadjusted());
if (!bda.equals(startDate.getAdjustment())) {
 accrualScheduleBuilder.startDateBusinessDayAdjustment(startDate.getAdjustment());
  .orElseGet(() -> document.parseAdjustedRelativeDateOffset(calcPeriodDatesEl.getChild("relativeTerminationDate")));
accrualScheduleBuilder.endDate(endDate.getUnadjusted());
if (!bda.equals(endDate.getAdjustment())) {
 accrualScheduleBuilder.endDateBusinessDayAdjustment(endDate.getAdjustment());
origin: OpenGamma/Strata

public void fra_noParty() {
 String location = "classpath:com/opengamma/strata/loader/fpml/ird-ex08-fra.xml";
 ByteSource resource = ResourceLocator.of(location).getByteSource();
 List<Trade> trades = FpmlDocumentParser.of(FpmlPartySelector.any()).parseTrades(resource);
 assertEquals(trades.size(), 1);
 Trade trade = trades.get(0);
 assertEquals(trade.getClass(), FraTrade.class);
 FraTrade fraTrade = (FraTrade) trade;
 assertEquals(fraTrade.getInfo().getTradeDate(), Optional.of(date(1991, 5, 14)));
 Fra fra = fraTrade.getProduct();
 assertEquals(fra.getBuySell(), BUY);
 assertEquals(fra.getStartDate(), date(1991, 7, 17));
 assertEquals(fra.getEndDate(), date(1992, 1, 17));
 assertEquals(fra.getBusinessDayAdjustment(), Optional.empty());
 assertEquals(fra.getPaymentDate().getUnadjusted(), date(1991, 7, 17));
 assertEquals(fra.getPaymentDate().getAdjustment(), BusinessDayAdjustment.of(FOLLOWING, CHZU));
 assertEquals(fra.getFixingDateOffset().getDays(), -2);
 assertEquals(fra.getFixingDateOffset().getCalendar(), GBLO);
 assertEquals(fra.getFixingDateOffset().getAdjustment(), BusinessDayAdjustment.NONE);
 assertEquals(fra.getDayCount(), ACT_360);
 assertEquals(fra.getCurrency(), CHF);
 assertEquals(fra.getNotional(), 25000000d);
 assertEquals(fra.getFixedRate(), 0.04d);
 assertEquals(fra.getIndex(), CHF_LIBOR_6M);
 assertEquals(fra.getIndexInterpolated(), Optional.empty());
 assertEquals(fra.getDiscounting(), FraDiscountingMethod.ISDA);
 // check same when using a specific selector instead of FpmlPartySelector.any()
 List<Trade> trades2 = FpmlDocumentParser.of(allParties -> ImmutableList.of()).parseTrades(resource);
 assertEquals(trades2, trades);
}
origin: OpenGamma/Strata

PeriodicSchedule.Builder scheduleBuilder = PeriodicSchedule.builder()
  .startDate(effectiveDate.getUnadjusted())
  .startDateBusinessDayAdjustment(effectiveDate.getAdjustment())
  .endDate(terminationDate.getUnadjusted())
  .endDateBusinessDayAdjustment(terminationDate.getAdjustment())
  .businessDayAdjustment(bda);
com.opengamma.strata.basics.dateAdjustableDategetAdjustment

Javadoc

Gets the business day adjustment that is to be applied to the unadjusted date.

This is used to adjust the date if it is not a business day.

Popular methods of AdjustableDate

  • of
    Obtains an instance with a business day adjustment. This creates an adjustable date from the unadjus
  • getUnadjusted
    Gets the unadjusted date. This date may be a non-business day. The business day adjustment is used t
  • adjusted
    Adjusts the date using the business day adjustment. This returns the adjusted date, calculated by ap
  • <init>
  • equals
  • toString
    Returns a string describing the adjustable date.

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JTextField (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now