Examples of fieldValueToObject()


Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

    FudgeDeserializer deserializationContext = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    Set<ExternalIdBundle> identifierSet = deserializationContext.fudgeMsgToObject(Set.class, msg.getMessage("id"));
    String dataSource = msg.getString("dataSource");
    String dataProvider = msg.getString("dataProvider");
    String dataField = msg.getString("dataField");
    LocalDate start = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("start"));
    boolean inclusiveStart = msg.getBoolean("includeStart");
    LocalDate end = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("end"));
    boolean includeEnd = msg.getBoolean("includeEnd");
   
    Map<ExternalIdBundle, HistoricalTimeSeries> result = getHistoricalTimeSeriesSource().getHistoricalTimeSeries(
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

    String dataSource = msg.getString("dataSource");
    String dataProvider = msg.getString("dataProvider");
    String dataField = msg.getString("dataField");
    LocalDate start = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("start"));
    boolean inclusiveStart = msg.getBoolean("includeStart");
    LocalDate end = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("end"));
    boolean includeEnd = msg.getBoolean("includeEnd");
   
    Map<ExternalIdBundle, HistoricalTimeSeries> result = getHistoricalTimeSeriesSource().getHistoricalTimeSeries(
        identifierSet, dataSource, dataProvider, dataField, start, inclusiveStart, end, includeEnd);
    return responseOkFudge(FudgeMapWrapper.of(result));
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

  @SuppressWarnings("unchecked")
  private <R> Collection<ConfigItem<R>> configItemCollectionResult(final FudgeMsg msg) {
    final Collection<ConfigItem<R>> result = Lists.newArrayListWithCapacity(msg.getNumFields());
    final FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    for (final FudgeField field : msg) {
      result.add(deserializer.fieldValueToObject(ConfigItem.class, field));
    }
    return result;
  }

  @Override
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

    final FudgeSerializer serializer = new FudgeSerializer(s_fudgeContext);
    final MutableFudgeMsg messageIn = serializer.newMessage();
    serializer.addToMessage(messageIn, "test", null, expiry);
    final FudgeMsg messageOut = cycleMessage(messageIn);
    final FudgeDeserializer dsrContext = new FudgeDeserializer(s_fudgeContext);
    final Expiry result = dsrContext.fieldValueToObject(Expiry.class, messageOut.getByName("test"));
    assertEquals(expiry, result);
    assertEquals(expiry.getExpiry().getZone(), result.getExpiry().getZone());
  }

  public void testFudgeMessageUTC() {
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

      }
      final URI req = uri.build();
      final FudgeMsg response = accessRemote(req).get(FudgeMsg.class);
      final String adjustment = response.getString("adjustment");
      return new HistoricalTimeSeriesResolutionResult(
          fdc.fieldValueToObject(ManageableHistoricalTimeSeriesInfo.class, response.getByName("info")),
          (adjustment != null) ? new Adjuster(req, identifierBundle, adjustment) : null);
    } catch (UniformInterfaceException404NotFound e) {
      return null;
    }
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

    final MutableFudgeMsg messageIn = fudgeSerializationContext.newMessage();
    fudgeSerializationContext.addToMessageWithClassHeaders(messageIn, "test", null, object, clazz);
    s_logger.info("message {}", messageIn);
    final FudgeMsg messageOut = cycleMessage(messageIn);
    s_logger.info("message {}", messageOut);
    final T newObject = fudgeDeserializationContext.fieldValueToObject(clazz, messageOut.getByName("test"));
    assertNotNull(newObject);
    s_logger.info("object {}", newObject);
    assertTrue(clazz.isAssignableFrom(newObject.getClass()));
    return newObject;
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

      FudgeField field = msg.getByName(DataFunctionBlacklistResource.RULES_ADDED_FIELD);
      final FudgeDeserializer fdc = new FudgeDeserializer(fudgeContext);
      if (field != null) {
        final List<FudgeField> rulesMsg = msg.getFieldValue(FudgeMsg.class, field).getAllFields();
        if (rulesMsg.size() == 1) {
          ruleAdded(modificationCount, fdc.fieldValueToObject(FunctionBlacklistRule.class, rulesMsg.get(0)), getProvider().getBackgroundTasks());
        } else {
          final List<FunctionBlacklistRule> rules = new ArrayList<FunctionBlacklistRule>(rulesMsg.size());
          for (FudgeField ruleField : rulesMsg) {
            rules.add(fdc.fieldValueToObject(FunctionBlacklistRule.class, ruleField));
          }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

        if (rulesMsg.size() == 1) {
          ruleAdded(modificationCount, fdc.fieldValueToObject(FunctionBlacklistRule.class, rulesMsg.get(0)), getProvider().getBackgroundTasks());
        } else {
          final List<FunctionBlacklistRule> rules = new ArrayList<FunctionBlacklistRule>(rulesMsg.size());
          for (FudgeField ruleField : rulesMsg) {
            rules.add(fdc.fieldValueToObject(FunctionBlacklistRule.class, ruleField));
          }
          rulesAdded(modificationCount, rules, getProvider().getBackgroundTasks());
        }
      }
      field = msg.getByName(DataFunctionBlacklistResource.RULES_REMOVED_FIELD);
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

      }
      field = msg.getByName(DataFunctionBlacklistResource.RULES_REMOVED_FIELD);
      if (field != null) {
        final List<FudgeField> rulesMsg = msg.getFieldValue(FudgeMsg.class, field).getAllFields();
        if (rulesMsg.size() == 1) {
          ruleRemoved(modificationCount, fdc.fieldValueToObject(FunctionBlacklistRule.class, rulesMsg.get(0)), getProvider().getBackgroundTasks());
        } else {
          final List<FunctionBlacklistRule> rules = new ArrayList<FunctionBlacklistRule>(rulesMsg.size());
          for (FudgeField ruleField : rulesMsg) {
            rules.add(fdc.fieldValueToObject(FunctionBlacklistRule.class, ruleField));
          }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fieldValueToObject()

        if (rulesMsg.size() == 1) {
          ruleRemoved(modificationCount, fdc.fieldValueToObject(FunctionBlacklistRule.class, rulesMsg.get(0)), getProvider().getBackgroundTasks());
        } else {
          final List<FunctionBlacklistRule> rules = new ArrayList<FunctionBlacklistRule>(rulesMsg.size());
          for (FudgeField ruleField : rulesMsg) {
            rules.add(fdc.fieldValueToObject(FunctionBlacklistRule.class, ruleField));
          }
          rulesRemoved(modificationCount, rules, getProvider().getBackgroundTasks());
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.