本文整理了Java中com.opengamma.strata.market.param.YearMonthDateParameterMetadata.getDate()
方法的一些代码示例,展示了YearMonthDateParameterMetadata.getDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonthDateParameterMetadata.getDate()
方法的具体详情如下:
包路径:com.opengamma.strata.market.param.YearMonthDateParameterMetadata
类名称:YearMonthDateParameterMetadata
方法名:getDate
[英]Gets the date associated with the parameter.
This is the date that is most closely associated with the parameter. The actual parameter is typically a year fraction based on a day count.
[中]获取与参数关联的日期。
这是与参数关联最密切的日期。实际参数通常是基于天数的年分数。
代码示例来源:origin: OpenGamma/Strata
@Override
protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
switch (propertyName.hashCode()) {
case 3076014: // date
return ((YearMonthDateParameterMetadata) bean).getDate();
case -496678845: // yearMonth
return ((YearMonthDateParameterMetadata) bean).getYearMonth();
case 102727412: // label
return ((YearMonthDateParameterMetadata) bean).getLabel();
}
return super.propertyGet(bean, propertyName, quiet);
}
代码示例来源:origin: OpenGamma/Strata
public void test_of_label() {
YearMonthDateParameterMetadata test = YearMonthDateParameterMetadata.of(DATE, JAN2015, "Jan 2015");
assertEquals(test.getDate(), DATE);
assertEquals(test.getYearMonth(), JAN2015);
assertEquals(test.getLabel(), "Jan 2015");
assertEquals(test.getIdentifier(), JAN2015);
}
代码示例来源:origin: OpenGamma/Strata
public void test_of_noLabel() {
YearMonthDateParameterMetadata test = YearMonthDateParameterMetadata.of(DATE, JAN2015);
assertEquals(test.getDate(), DATE);
assertEquals(test.getYearMonth(), JAN2015);
assertEquals(test.getLabel(), "Jan15");
assertEquals(test.getIdentifier(), JAN2015);
}
代码示例来源:origin: OpenGamma/Strata
public void test_metadata_end() {
IborFutureCurveNode node = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL);
LocalDate date = LocalDate.of(2015, 10, 20);
LocalDate referenceDate = TEMPLATE.calculateReferenceDateFromTradeDate(date, REF_DATA);
LocalDate maturityDate = TEMPLATE.getIndex().calculateMaturityFromEffective(referenceDate, REF_DATA);
ParameterMetadata metadata = node.metadata(date, REF_DATA);
assertEquals(metadata.getLabel(), LABEL);
assertTrue(metadata instanceof YearMonthDateParameterMetadata);
assertEquals(((YearMonthDateParameterMetadata) metadata).getDate(), maturityDate);
assertEquals(((YearMonthDateParameterMetadata) metadata).getYearMonth(), YearMonth.from(referenceDate));
}
代码示例来源:origin: OpenGamma/Strata
public void test_builder_defaultLabel() {
BeanBuilder<? extends YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();
builder.set(YearMonthDateParameterMetadata.meta().date(), DATE);
builder.set(YearMonthDateParameterMetadata.meta().yearMonth(), JAN2015);
YearMonthDateParameterMetadata test = builder.build();
assertEquals(test.getDate(), DATE);
assertEquals(test.getYearMonth(), JAN2015);
assertEquals(test.getLabel(), "Jan15");
assertEquals(test.getIdentifier(), JAN2015);
}
代码示例来源:origin: OpenGamma/Strata
public void test_builder_specifyLabel() {
BeanBuilder<? extends YearMonthDateParameterMetadata> builder = YearMonthDateParameterMetadata.meta().builder();
builder.set(YearMonthDateParameterMetadata.meta().date(), DATE);
builder.set(YearMonthDateParameterMetadata.meta().yearMonth(), JAN2015);
builder.set(YearMonthDateParameterMetadata.meta().label(), "Jan 2015");
YearMonthDateParameterMetadata test = builder.build();
assertEquals(test.getDate(), DATE);
assertEquals(test.getYearMonth(), JAN2015);
assertEquals(test.getLabel(), "Jan 2015");
assertEquals(test.getIdentifier(), JAN2015);
}
内容来源于网络,如有侵权,请联系作者删除!