public final class SummarizerUtils extends Object
This class provides a central place for description logic.
| Modifier and Type | Method and Description |
|---|---|
static String |
amount(CurrencyAmount currencyAmount)
Converts an amount to a string.
|
static String |
amount(Currency currency,
double value)
Converts an amount to a string.
|
static String |
barrier(Barrier barrier,
LocalDate barrierObsDate)
Provide a summary description of the given barrier.
|
static String |
date(LocalDate date)
Converts a date to a string.
|
static String |
datePeriod(LocalDate start,
LocalDate end)
Converts a date range to a period string.
|
static String |
dateRange(LocalDate start,
LocalDate end)
Converts a date range to a string.
|
static String |
fx(CurrencyAmount base,
CurrencyAmount counter)
Converts an FX exchange to a string.
|
static String |
payReceive(PayReceive payReceive)
Converts pay/receive to a string.
|
static String |
percent(double decimalForm)
Converts a value to a percentage string.
|
static PortfolioItemSummary |
summary(Position position,
ProductType type,
String description,
Currency... currencies)
Creates a summary instance for a position.
|
static PortfolioItemSummary |
summary(Trade trade,
ProductType type,
String description,
Currency... currencies)
Creates a summary instance for a trade.
|
static String |
value(double value)
Converts a value to a string.
|
public static String date(LocalDate date)
date - the datepublic static String dateRange(LocalDate start, LocalDate end)
start - the start dateend - the end datepublic static String datePeriod(LocalDate start, LocalDate end)
start - the start dateend - the end datepublic static String amount(CurrencyAmount currencyAmount)
currencyAmount - the amountpublic static String amount(Currency currency, double value)
currency - the currencyvalue - the valuepublic static String value(double value)
value - the valuepublic static String percent(double decimalForm)
decimalForm - the value in decimal formpublic static String payReceive(PayReceive payReceive)
payReceive - the valuepublic static String fx(CurrencyAmount base, CurrencyAmount counter)
base - the base currency amountcounter - the counter currency amountpublic static String barrier(Barrier barrier, LocalDate barrierObsDate)
Summary contains the barrier level, the type and the knock type e.g. "Up-and-KnockOut @ 1.25".
barrier - the barrierbarrierObsDate - the date on which the barrier level should be observedpublic static PortfolioItemSummary summary(Position position, ProductType type, String description, Currency... currencies)
position - the positiontype - the typedescription - the descriptioncurrencies - the currencies, may be emptypublic static PortfolioItemSummary summary(Trade trade, ProductType type, String description, Currency... currencies)
trade - the tradetype - the typedescription - the descriptioncurrencies - the currencies, may be emptyCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.