Class TargetTypeCalculationParameter

    • Method Detail

      • of

        public static TargetTypeCalculationParameter of​(Map<Class<?>,​CalculationParameter> parameters,
                                                        CalculationParameter defaultParameter)
        Obtains an instance from the specified parameters.

        The map provides a lookup from the CalculationTarget implementation type to the appropriate parameter to use for that target. If a target is requested that is not in the map, the default parameter is used.

        parameters - the parameters, keyed by target type
        defaultParameter - the default parameter
        the target aware parameter
      • filter

        public Optional<CalculationParameter> filter​(CalculationTarget target,
                                                     Measure measure)
        Description copied from interface: CalculationParameter
        Filters this parameter to the specified target and measure.

        Parameters may apply to all targets and measures or just a subset. The CalculationParameters.filter(CalculationTarget, Measure) method uses this method to filter a complete set of parameters.

        By default, this returns Optional.of(this). If the parameter does not apply to either the target or measure, then optional empty must be returned. If desired, the result can be a different parameter, allowing one parameter to delegate to another when filtered.

        Specified by:
        filter in interface CalculationParameter
        target - the calculation target, such as a trade
        measure - the measure to be calculated
        the parameter appropriate to the target and measure, empty if this parameter does not apply
      • meta

        public static org.joda.beans.TypedMetaBean<TargetTypeCalculationParameter> meta()
        The meta-bean for TargetTypeCalculationParameter.
        the meta-bean, not null
      • getQueryType

        public Class<? extends CalculationParameter> getQueryType()
        Gets the parameter query type.
        the value of the property, not null
      • getParameters

        public ImmutableMap<Class<?>,​CalculationParameter> getParameters()
        Gets the underlying parameters, keyed by target type.
        the value of the property, not null
      • getDefaultParameter

        public CalculationParameter getDefaultParameter()
        Gets the default underlying parameter.
        the value of the property, not null
      • hashCode

        public int hashCode()
        hashCode in class Object