Class Column
- java.lang.Object
-
- com.opengamma.strata.calc.Column
-
- All Implemented Interfaces:
org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class Column extends Object implements org.joda.beans.ImmutableBean
Defines a column in a set of calculation results.CalculationRunnerprovides the ability to calculate a grid of results for a given set targets and columns. This class is used to define the columns.A column is defined in terms of a unique name, measure to be calculated and a set of parameters that control the calculation. The functions to invoke and the default set of parameters are defined on
CalculationRules.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColumn.BuilderThe bean-builder forColumn.static classColumn.MetaThe meta-bean forColumn.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Column.Builderbuilder()Returns a builder used to create an instance of the bean.ColumncombineWithDefaults(ReportingCurrency reportingCurrency, CalculationParameters defaultParameters)Combines the parameters with another reporting currency and set of parameters.booleanequals(Object obj)MeasuregetMeasure()Gets the measure to be calculated.ColumnNamegetName()Gets the column name.CalculationParametersgetParameters()Gets the calculation parameters that apply to this column, used to control the how the calculation is performed.Optional<ReportingCurrency>getReportingCurrency()Gets the reporting currency, used to control currency conversion, optional.inthashCode()static Column.Metameta()The meta-bean forColumn.Column.MetametaBean()static Columnof(Measure measure)Obtains an instance that will calculate the specified measure.static Columnof(Measure measure, Currency currency)Obtains an instance that will calculate the specified measure, converting to the specified currency.static Columnof(Measure measure, Currency currency, CalculationParameter... parameters)Obtains an instance that will calculate the specified measure, converting to the specified currency, defining additional parameters.static Columnof(Measure measure, CalculationParameter... parameters)Obtains an instance that will calculate the specified measure, defining additional parameters.static Columnof(Measure measure, String columnName)Obtains an instance that will calculate the specified measure, defining the column name.static Columnof(Measure measure, String columnName, Currency currency)Obtains an instance that will calculate the specified measure, converting to the specified currency.static Columnof(Measure measure, String columnName, Currency currency, CalculationParameter... parameters)Obtains an instance that will calculate the specified measure, converting to the specified currency, defining the column name and parameters.static Columnof(Measure measure, String columnName, CalculationParameter... parameters)Obtains an instance that will calculate the specified measure, defining the column name and parameters.Column.BuildertoBuilder()Returns a builder that allows this bean to be mutated.ColumnHeadertoHeader()Converts this column to a column header.StringtoString()
-
-
-
Method Detail
-
of
public static Column of(Measure measure)
Obtains an instance that will calculate the specified measure.The column name will be the same as the name of the measure. No calculation parameters are provided, thus the parameters from
CalculationRuleswill be used. Currency conversion is controlled by the reporting currency inCalculationRules.- Parameters:
measure- the measure to be calculated- Returns:
- a column with the specified measure
-
of
public static Column of(Measure measure, Currency currency)
Obtains an instance that will calculate the specified measure, converting to the specified currency.The column name will be the same as the name of the measure.
- Parameters:
measure- the measure to be calculatedcurrency- the currency to convert to- Returns:
- a column with the specified measure
-
of
public static Column of(Measure measure, CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, defining additional parameters.The column name will be the same as the name of the measure. The specified calculation parameters take precedence over those in
CalculationRules, with the combined set being used for the column. Currency conversion is controlled by the reporting currency inCalculationRules.- Parameters:
measure- the measure to be calculatedparameters- the parameters that control the calculation, may be empty- Returns:
- a column with the specified measure and reporting currency
-
of
public static Column of(Measure measure, Currency currency, CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, converting to the specified currency, defining additional parameters.The column name will be the same as the name of the measure. The specified calculation parameters take precedence over those in
CalculationRules, with the combined set being used for the column.- Parameters:
measure- the measure to be calculatedcurrency- the currency to convert toparameters- the parameters that control the calculation, may be empty- Returns:
- a column with the specified measure and reporting currency
-
of
public static Column of(Measure measure, String columnName)
Obtains an instance that will calculate the specified measure, defining the column name.No calculation parameters are provided, thus the parameters from
CalculationRuleswill be used. Currency conversion is controlled by the reporting currency inCalculationRules.- Parameters:
measure- the measure to be calculatedcolumnName- the column name- Returns:
- a column with the specified measure and column name
-
of
public static Column of(Measure measure, String columnName, Currency currency)
Obtains an instance that will calculate the specified measure, converting to the specified currency.The specified currency will be wrapped in
ReportingCurrencyand added to the calculation parameters.- Parameters:
measure- the measure to be calculatedcolumnName- the column namecurrency- the currency to convert to- Returns:
- a column with the specified measure
-
of
public static Column of(Measure measure, String columnName, CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, defining the column name and parameters.The specified calculation parameters take precedence over those in
CalculationRules, with the combined set being used for the column. Currency conversion is controlled by the reporting currency inCalculationRules.- Parameters:
measure- the measure to be calculatedcolumnName- the column nameparameters- the parameters that control the calculation, may be empty- Returns:
- a column with the specified measure, column name and reporting currency
-
of
public static Column of(Measure measure, String columnName, Currency currency, CalculationParameter... parameters)
Obtains an instance that will calculate the specified measure, converting to the specified currency, defining the column name and parameters.The specified calculation parameters take precedence over those in
CalculationRules, with the combined set being used for the column.- Parameters:
measure- the measure to be calculatedcolumnName- the column namecurrency- the currency to convert toparameters- the parameters that control the calculation, may be empty- Returns:
- a column with the specified measure, column name and reporting currency
-
combineWithDefaults
public Column combineWithDefaults(ReportingCurrency reportingCurrency, CalculationParameters defaultParameters)
Combines the parameters with another reporting currency and set of parameters.- Parameters:
reportingCurrency- the default reporting currencydefaultParameters- the default parameters- Returns:
- the combined column
-
toHeader
public ColumnHeader toHeader()
Converts this column to a column header.The header is a reduced form of the column used in
Results.- Returns:
- the column header
-
meta
public static Column.Meta meta()
The meta-bean forColumn.- Returns:
- the meta-bean, not null
-
builder
public static Column.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public Column.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public ColumnName getName()
Gets the column name.This is the name of the column, and should be unique in a list of columns.
- Returns:
- the value of the property, not null
-
getMeasure
public Measure getMeasure()
Gets the measure to be calculated.This defines the calculation being performed, such as 'PresentValue' or 'ParRate'.
- Returns:
- the value of the property, not null
-
getReportingCurrency
public Optional<ReportingCurrency> getReportingCurrency()
Gets the reporting currency, used to control currency conversion, optional.This is used to specify the currency that the result should be reporting in. If the result is not associated with a currency, such as for "par rate", then the reporting currency will effectively be ignored.
If empty, the reporting currency from
CalculationRuleswill be used.- Returns:
- the optional value of the property, not null
-
getParameters
public CalculationParameters getParameters()
Gets the calculation parameters that apply to this column, used to control the how the calculation is performed.The parameters from
CalculationRulesandColumnare combined. If a parameter is defined here and in the rules with the same query type, then the column parameter takes precedence.When building, these will default to be empty.
- Returns:
- the value of the property
-
toBuilder
public Column.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-