Package com.opengamma.engine.function.resolver

Examples of com.opengamma.engine.function.resolver.SimpleResolutionRuleTransform$Adjust


    calcConfig1.setScenarioId(UniqueId.of("ScenarioDefinition", "sd1"));

    final ViewCalculationConfiguration calcConfig2 = new ViewCalculationConfiguration(viewDefinition, "2");
    calcConfig2.addSpecificRequirement(new ValueRequirement("Value2", ComputationTargetType.PRIMITIVE, UniqueId.of("Test", "Foo")));
    calcConfig2.addSpecificRequirement(new ValueRequirement("Value2", ComputationTargetType.PRIMITIVE, UniqueId.of("Test", "Bar")));
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    transform.suppressRule("Foo");
    calcConfig2.setResolutionRuleTransform(transform);

    viewDefinition.setDefaultCurrency(Currency.USD);
    viewDefinition.addViewCalculationConfiguration(calcConfig1);
    viewDefinition.addViewCalculationConfiguration(calcConfig2);
View Full Code Here


    return message;
  }

  @Override
  public SimpleResolutionRuleTransform buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    for (FudgeField field : message) {
      if (field.getName() != null) {
        if (field.getValue() == IndicatorType.INSTANCE) {
          transform.suppressRule(field.getName());
        } else if (field.getValue() instanceof FudgeMsg) {
          final FudgeMsg action = (FudgeMsg) field.getValue();
          final FudgeField parameters = action.getByName(PARAMETERS_FIELD);
          final FudgeField filter = action.getByName(FILTER_FIELD);
          final FudgeField priority = action.getByName(PRIORITY_FIELD);
          transform.adjustRule(field.getName(), (parameters != null) ? deserializer.fieldValueToObject(FunctionParameters.class, parameters) : null, (filter != null) ? deserializer.fieldValueToObject(
              ComputationTargetFilter.class, filter) : null, (priority != null) ? message.getFieldValue(Integer.class, priority) : null);
        }
      }
    }
    return transform;
View Full Code Here

*/
@Test(groups = TestGroup.UNIT)
public class SimpleResolutionRuleTransformBuilderTest extends AbstractFudgeBuilderTestCase {

  public void testEmpty() {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }
View Full Code Here

    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform();
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }

  public void testPopulated () {
    final SimpleResolutionRuleTransform transform = new SimpleResolutionRuleTransform ();
    transform.suppressRule("Foo");
    transform.adjustRule("Bar", new EmptyFunctionParameters(), null, null);
    transform.adjustRule("Bar", null, ApplyToAllTargets.INSTANCE, null);
    transform.adjustRule("Bar", null, null, 42);
    transform.adjustRule("Cow", new EmptyFunctionParameters(), ApplyToAllTargets.INSTANCE, -42);
    assertEncodeDecodeCycle(ResolutionRuleTransform.class, transform);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.function.resolver.SimpleResolutionRuleTransform$Adjust

Copyright © 2018 www.massapicom. 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.