/** * Returns the appropriate {@link ComplexMetric} that is mapped from the given <code>alias</code> * if it exists, and is used in the expected context with the given {@link AggregateCall}. * Otherwise returns <code>null</code>. * */ public ComplexMetric resolveComplexMetric(String alias, AggregateCall call) { List<ComplexMetric> potentialMetrics = getComplexMetricsFrom(alias); // It's possible that multiple complex metrics match the AggregateCall, // but for now we only return the first that matches for (ComplexMetric complexMetric : potentialMetrics) { if (complexMetric.canBeUsed(call)) { return complexMetric; } } return null; }
/** * Returns the appropriate {@link ComplexMetric} that is mapped from the given <code>alias</code> * if it exists, and is used in the expected context with the given {@link AggregateCall}. * Otherwise returns <code>null</code>. * */ public ComplexMetric resolveComplexMetric(String alias, AggregateCall call) { List<ComplexMetric> potentialMetrics = getComplexMetricsFrom(alias); // It's possible that multiple complex metrics match the AggregateCall, // but for now we only return the first that matches for (ComplexMetric complexMetric : potentialMetrics) { if (complexMetric.canBeUsed(call)) { return complexMetric; } } return null; }