public void test_serialization() { SimpleSurfaceParameterMetadata test = SimpleSurfaceParameterMetadata.of( ValueType.YEAR_FRACTION, 1d, ValueType.STRIKE, 3d); assertSerialization(test); }
public void coverage() { SimpleSurfaceParameterMetadata test = SimpleSurfaceParameterMetadata.of( ValueType.YEAR_FRACTION, 1d, ValueType.STRIKE, 3d); coverImmutableBean(test); SimpleSurfaceParameterMetadata test2 = SimpleSurfaceParameterMetadata.of( ValueType.ZERO_RATE, 2d, ValueType.SIMPLE_MONEYNESS, 4d); coverBeanEquals(test, test2); }
/** * Gets the metadata of the parameter at the specified index. * <p> * If there is no specific parameter metadata, {@link SimpleSurfaceParameterMetadata} will be created. * * @param parameterIndex the zero-based index of the parameter to get * @return the metadata of the parameter * @throws IndexOutOfBoundsException if the index is invalid */ @Override public default ParameterMetadata getParameterMetadata(int parameterIndex) { return getMetadata().getParameterMetadata().map(pm -> pm.get(parameterIndex)) .orElse(SimpleSurfaceParameterMetadata.of( getMetadata().getXValueType(), getXValues().get(parameterIndex), getMetadata().getYValueType(), getYValues().get(parameterIndex))); }
public void test_of() { SimpleSurfaceParameterMetadata test = SimpleSurfaceParameterMetadata.of( ValueType.YEAR_FRACTION, 1d, ValueType.STRIKE, 3d); assertEquals(test.getXValueType(), ValueType.YEAR_FRACTION); assertEquals(test.getXValue(), 1d); assertEquals(test.getYValueType(), ValueType.STRIKE); assertEquals(test.getYValue(), 3d); assertEquals(test.getLabel(), "YearFraction=1.0, Strike=3.0"); assertEquals(test.getIdentifier(), "YearFraction=1.0, Strike=3.0"); }