Package com.opengamma.engine.value.ValueProperties

Examples of com.opengamma.engine.value.ValueProperties.Builder


    final Set<String> adjustValues = desiredValue.getConstraints().getValues(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY);
    final Set<String> ageLimitValues = desiredValue.getConstraints().getValues(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY);
    if (adjustValues != null && adjustValues.size() == 1 && ageLimitValues != null && ageLimitValues.size() == 1) {
      return ImmutableSet.of();
    }
    final Builder constraints = desiredValue.getConstraints().copy();
    if (adjustValues == null || adjustValues.isEmpty()) {
      constraints.withoutAny(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY)
          .with(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY, "");
    } else {
      constraints.withoutAny(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY)
          .with(HistoricalTimeSeriesFunctionUtils.ADJUST_PROPERTY, adjustValues.iterator().next());
    }
    if (ageLimitValues == null || ageLimitValues.isEmpty()) {
      constraints.withoutAny(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY)
          .with(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY, HistoricalTimeSeriesFunctionUtils.UNLIMITED_AGE_LIMIT_VALUE);
    } else {
      constraints.withoutAny(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY)
          .with(HistoricalTimeSeriesFunctionUtils.AGE_LIMIT_PROPERTY, ageLimitValues.iterator().next());
    }
    return ImmutableSet.of(new ValueRequirement(ValueRequirementNames.HISTORICAL_TIME_SERIES_LATEST, target.toSpecification(), constraints.get()));
  }
View Full Code Here


  }

  public static ValueRequirement createHTSRequirement(final HistoricalTimeSeriesResolutionResult timeSeries, final String dataField, final ValueProperties constraints) {
    final HistoricalTimeSeriesAdjuster adjuster = timeSeries.getAdjuster();
    final String adjustment = (adjuster == null) ? "" : adjuster.getAdjustment(timeSeries.getHistoricalTimeSeriesInfo().getExternalIdBundle().toBundle()).toString();
    final Builder properties = constraints.copy()
        .with(DATA_FIELD_PROPERTY, dataField)
        .with(ADJUST_PROPERTY, adjustment);
    return new ValueRequirement(ValueRequirementNames.HISTORICAL_TIME_SERIES, ComputationTargetType.PRIMITIVE, timeSeries.getHistoricalTimeSeriesInfo().getUniqueId(),
        properties.get());
  }
View Full Code Here

  public static ValueRequirement createHTSRequirement(final HistoricalTimeSeriesResolutionResult timeSeries, final String dataField, final DateConstraint startDate, final boolean includeStart,
      final DateConstraint endDate, final boolean includeEnd) {
    final HistoricalTimeSeriesAdjuster adjuster = timeSeries.getAdjuster();
    final String adjustment = (adjuster == null) ? "" : adjuster.getAdjustment(timeSeries.getHistoricalTimeSeriesInfo().getExternalIdBundle().toBundle()).toString();
    final Builder properties = htsConstraints(ValueProperties.builder(), startDate, includeStart, endDate, includeEnd)
        .with(DATA_FIELD_PROPERTY, dataField)
        .with(ADJUST_PROPERTY, adjustment);
    return new ValueRequirement(ValueRequirementNames.HISTORICAL_TIME_SERIES, ComputationTargetType.PRIMITIVE, timeSeries.getHistoricalTimeSeriesInfo().getUniqueId(),
        properties.get());
  }
View Full Code Here

   @param dataField Name of time series value. Example "Close"
   @param constraints {@link ValueProperties}
   @return The {@link ValueRequirement} "Historical Time Series (latest value)"
   */
  public static ValueRequirement createHTSLatestRequirement(final Security security, final String dataField, final ValueProperties constraints) {
    final Builder properties = (constraints == null ? ValueProperties.none() : constraints).copy().with(DATA_FIELD_PROPERTY, dataField);
    return new ValueRequirement(ValueRequirementNames.HISTORICAL_TIME_SERIES_LATEST, ComputationTargetSpecification.of(security), properties.get());
  }
View Full Code Here

    }
    return ret;
  }

  private ValueSpecification getSpec(final ValueProperties props) {
    final Builder realProps = props.copy().with(ValuePropertyNames.FUNCTION, "SomeFunc");
    final ValueSpecification spec = new ValueSpecification("X", ComputationTargetSpecification.of(Currency.USD), realProps.get());
    return spec;
  }
View Full Code Here

      if (getValueRequirementName().equals(input.getValueName())) {
        return inputs.keySet();
      }
    }
    ValueSpecification superSpec = super.getResults(context, target, inputs).iterator().next();
    Builder properties = superSpec.getProperties().copy()
        .withAny(s_priceShift)
        .withAny(s_volShift)
        .withAny(s_priceShiftType)
        .withAny(s_volShiftType);
       
    return Collections.singleton(new ValueSpecification(getValueRequirementName(), target.toSpecification(), properties.get()));   
  }
View Full Code Here

      if (getValueRequirementName().equals(input.getValueName())) {
        return inputs.keySet();
      }
    }
    ValueSpecification superSpec = super.getResults(context, target, inputs).iterator().next();
    Builder properties = superSpec.getProperties().copy()
        .withAny(s_priceShift)
        .withAny(s_volShift)
        .withAny(s_priceShiftType)
        .withAny(s_volShiftType);
       
    return Collections.singleton(new ValueSpecification(getValueRequirementName(), target.toSpecification(), properties.get()));   
  }
View Full Code Here

      if (getValueRequirementName().equals(input.getValueName())) {
        return inputs.keySet();
      }
    }
    ValueSpecification superSpec = super.getResults(context, target, inputs).iterator().next();
    Builder properties = superSpec.getProperties().copy()
        .withAny(s_priceShift)
        .withAny(s_volShift)
        .withAny(s_priceShiftType)
        .withAny(s_volShiftType);
       
    return Collections.singleton(new ValueSpecification(getValueRequirementName(), target.toSpecification(), properties.get()));   
  }
View Full Code Here

          uidCostOfCarry = input.getKey().getTargetSpecification().getUniqueId();
        }
      }
    }

    final Builder propertiesBuilder = createValueProperties(target);
    if (uidMarkToMarket != null) {
      propertiesBuilder.with("MarkToMarketTimeSeries", uidMarkToMarket.toString());
    }
    if (uidCostOfCarry != null) {
      propertiesBuilder.with("CostOfCarryTimeSeries",  uidCostOfCarry.toString());
    }
    return Collections.singleton(new ValueSpecification(getResultValueRequirementName(), target.toSpecification(), propertiesBuilder.get()));
  }
View Full Code Here

  }

  @Override
  protected Builder getResultProperties(final ComputationTarget target) {
    final Builder properties = super.getResultProperties(target);
    return properties.withAny(ValuePropertyNames.BINARY_OVERHEDGE)
        .withAny(ValuePropertyNames.BINARY_SMOOTHING_FULLWIDTH);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.value.ValueProperties.Builder

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.