@Override
 public CycleExecutionFailedCall buildObject(FudgeDeserializationContext context, FudgeMsg msg) {
   ViewCycleExecutionOptions cycleExecutionOptions =
       context.fieldValueToObject(
           ViewCycleExecutionOptions.class, msg.getByName(EXECUTION_OPTIONS_FIELD));
   FudgeField exceptionField = msg.getByName(EXCEPTION_FIELD);
   Exception exception =
       exceptionField != null ? context.fieldValueToObject(Exception.class, exceptionField) : null;
   return new CycleExecutionFailedCall(cycleExecutionOptions, exception);
 }
Ejemplo n.º 2
0
 protected Result(
     final org.fudgemsg.mapping.FudgeDeserializationContext fudgeContext,
     final org.fudgemsg.FudgeMsg fudgeMsg) {
   super(fudgeContext, fudgeMsg);
   org.fudgemsg.FudgeField fudgeField;
   fudgeField = fudgeMsg.getByName(RESULT_KEY);
   if (fudgeField == null)
     throw new IllegalArgumentException(
         "Fudge message is not a Result - field 'result' is not present");
   try {
     _result =
         fudgeContext.fieldValueToObject(
             com.opengamma.engine.view.calcnode.CalculationJobResult.class, fudgeField);
   } catch (IllegalArgumentException e) {
     throw new IllegalArgumentException(
         "Fudge message is not a Result - field 'result' is not CalculationJobResult message", e);
   }
   fudgeField = fudgeMsg.getByName(READY_KEY);
   if (fudgeField != null) {
     try {
       final com.opengamma.engine.view.calcnode.msg.Ready fudge1;
       fudge1 =
           com.opengamma.engine.view.calcnode.msg.Ready.fromFudgeMsg(
               fudgeContext, fudgeMsg.getFieldValue(org.fudgemsg.FudgeMsg.class, fudgeField));
       setReady(fudge1);
     } catch (IllegalArgumentException e) {
       throw new IllegalArgumentException(
           "Fudge message is not a Result - field 'ready' is not Ready message", e);
     }
   }
 }
 @Override
 public FixedIncomeStripWithSecurity buildObject(
     FudgeDeserializationContext context, FudgeMsg message) {
   StripInstrumentType type =
       context.fieldValueToObject(StripInstrumentType.class, message.getByName("type"));
   Tenor tenor = context.fieldValueToObject(Tenor.class, message.getByName("tenor"));
   Tenor resolvedTenor =
       context.fieldValueToObject(Tenor.class, message.getByName("resolvedTenor"));
   ZonedDateTimeBuilder zonedDateTimeBuilder = new ZonedDateTimeBuilder();
   ZonedDateTime maturity =
       zonedDateTimeBuilder.buildObject(context, message.getMessage("maturity"));
   Identifier identifier =
       context.fieldValueToObject(Identifier.class, message.getByName("identifier"));
   Security security = (Security) context.fieldValueToObject(message.getByName("security"));
   if (type == StripInstrumentType.FUTURE) {
     int numFutures = message.getInt("numFutures");
     return new FixedIncomeStripWithSecurity(
         type, tenor, resolvedTenor, numFutures, maturity, identifier, security);
   } else {
     return new FixedIncomeStripWithSecurity(
         type, tenor, resolvedTenor, maturity, identifier, security);
   }
 }
 protected SimpleChooserPayoffStyle(
     final org.fudgemsg.mapping.FudgeDeserializationContext fudgeContext,
     final org.fudgemsg.FudgeMsg fudgeMsg) {
   super(fudgeContext, fudgeMsg);
   org.fudgemsg.FudgeField fudgeField;
   fudgeField = fudgeMsg.getByName(CHOOSE_DATE_KEY);
   if (fudgeField == null)
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'chooseDate' is not present");
   try {
     _chooseDate =
         fudgeContext.fieldValueToObject(javax.time.calendar.ZonedDateTime.class, fudgeField);
   } catch (IllegalArgumentException e) {
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'chooseDate' is not ZonedDateTime typedef",
         e);
   }
   fudgeField = fudgeMsg.getByName(UNDERLYING_STRIKE_KEY);
   if (fudgeField == null)
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'underlyingStrike' is not present");
   try {
     _underlyingStrike = fudgeMsg.getFieldValue(Double.class, fudgeField);
   } catch (IllegalArgumentException e) {
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'underlyingStrike' is not double",
         e);
   }
   fudgeField = fudgeMsg.getByName(UNDERLYING_EXPIRY_KEY);
   if (fudgeField == null)
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'underlyingExpiry' is not present");
   try {
     _underlyingExpiry =
         com.opengamma.util.time.Expiry.fromFudgeMsg(
             fudgeContext, fudgeMsg.getFieldValue(org.fudgemsg.FudgeMsg.class, fudgeField));
   } catch (IllegalArgumentException e) {
     throw new IllegalArgumentException(
         "Fudge message is not a SimpleChooserPayoffStyle - field 'underlyingExpiry' is not Expiry message",
         e);
   }
 }