private static final String CONTINUOUS_ZERO_DEPOSIT = "continuousZeroDepositInstrumentProviders";
private static final String SWAP_28D = "swap28DInstrumentProviders";
@Override
public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final CurveSpecificationBuilderConfiguration object) {
final MutableFudgeMsg message = serializer.newMessage();
FudgeSerializer.addClassHeader(message, CurveSpecificationBuilderConfiguration.class);
if (object.getCashInstrumentProviders() != null) {
final MutableFudgeMsg cashInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getCashInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(cashInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(CASH, cashInstrumentProvidersMessage);
}
if (object.getFra3MInstrumentProviders() != null) {
final MutableFudgeMsg fra3MInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getFra3MInstrumentProviders().entrySet()) {
if (entry.getKey().getPeriod().toString() == null) {
throw new OpenGammaRuntimeException("null");
}
serializer.addToMessageWithClassHeaders(fra3MInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(FRA_3M, fra3MInstrumentProvidersMessage);
}
if (object.getFra6MInstrumentProviders() != null) {
final MutableFudgeMsg fra6MInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getFra6MInstrumentProviders().entrySet()) {
if (entry.getKey().getPeriod().toString() == null) {
throw new OpenGammaRuntimeException("null");
}
serializer.addToMessageWithClassHeaders(fra6MInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(FRA_6M, fra6MInstrumentProvidersMessage);
}
if (object.getFutureInstrumentProviders() != null) {
final MutableFudgeMsg futureInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getFutureInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(futureInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(FUTURE, futureInstrumentProvidersMessage);
}
if (object.getLiborInstrumentProviders() != null) {
final MutableFudgeMsg liborInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getLiborInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(liborInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(LIBOR, liborInstrumentProvidersMessage);
}
if (object.getEuriborInstrumentProviders() != null) {
final MutableFudgeMsg euriborInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getEuriborInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(euriborInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(EURIBOR, euriborInstrumentProvidersMessage);
}
if (object.getCDORInstrumentProviders() != null) {
final MutableFudgeMsg cdorInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getCDORInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(cdorInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(CDOR, cdorInstrumentProvidersMessage);
}
if (object.getCiborInstrumentProviders() != null) {
final MutableFudgeMsg ciborInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getCiborInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(ciborInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(CIBOR, ciborInstrumentProvidersMessage);
}
if (object.getStiborInstrumentProviders() != null) {
final MutableFudgeMsg stiborInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getStiborInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(stiborInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(STIBOR, stiborInstrumentProvidersMessage);
}
if (object.getSwap3MInstrumentProviders() != null) {
final MutableFudgeMsg swap3MInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getSwap3MInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(swap3MInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(SWAP_3M, swap3MInstrumentProvidersMessage);
}
if (object.getSwap6MInstrumentProviders() != null) {
final MutableFudgeMsg swap6MInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getSwap6MInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(swap6MInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(SWAP_6M, swap6MInstrumentProvidersMessage);
}
if (object.getSwap12MInstrumentProviders() != null) {
final MutableFudgeMsg swap12MInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getSwap12MInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(swap12MInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(SWAP_12M, swap12MInstrumentProvidersMessage);
}
if (object.getSwap28DInstrumentProviders() != null) {
final MutableFudgeMsg swap28DInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getSwap28DInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(swap28DInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(SWAP_28D, swap28DInstrumentProvidersMessage);
}
if (object.getBasisSwapInstrumentProviders() != null) {
final MutableFudgeMsg basisSwapInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getBasisSwapInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(basisSwapInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(BASIS_SWAP, basisSwapInstrumentProvidersMessage);
}
if (object.getTenorSwapInstrumentProviders() != null) {
final MutableFudgeMsg tenorSwapInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getTenorSwapInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(tenorSwapInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(TENOR_SWAP, tenorSwapInstrumentProvidersMessage);
}
if (object.getOISSwapInstrumentProviders() != null) {
final MutableFudgeMsg oisSwapInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getOISSwapInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(oisSwapInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(OIS_SWAP, oisSwapInstrumentProvidersMessage);
}
if (object.getSimpleZeroDepositInstrumentProviders() != null) {
final MutableFudgeMsg simpleZeroDepositInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getSimpleZeroDepositInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(simpleZeroDepositInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(SIMPLE_ZERO_DEPOSIT, simpleZeroDepositInstrumentProvidersMessage);
}
if (object.getPeriodicZeroDepositInstrumentProviders() != null) {
final MutableFudgeMsg periodicZeroDepositInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getPeriodicZeroDepositInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(periodicZeroDepositInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(PERIODIC_ZERO_DEPOSIT, periodicZeroDepositInstrumentProvidersMessage);
}
if (object.getContinuousZeroDepositInstrumentProviders() != null) {
final MutableFudgeMsg continuousZeroDepositInstrumentProvidersMessage = serializer.newMessage();
for (final Entry<Tenor, CurveInstrumentProvider> entry : object.getContinuousZeroDepositInstrumentProviders().entrySet()) {
serializer.addToMessageWithClassHeaders(continuousZeroDepositInstrumentProvidersMessage, entry.getKey().getPeriod().toString(), null, entry.getValue(), CurveInstrumentProvider.class);
}
message.add(CONTINUOUS_ZERO_DEPOSIT, continuousZeroDepositInstrumentProvidersMessage);
}