Class SwapLegAmount
- java.lang.Object
-
- com.opengamma.strata.market.amount.SwapLegAmount
-
- All Implemented Interfaces:
FxConvertible<LegAmount>,LegAmount,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class SwapLegAmount extends Object implements LegAmount, org.joda.beans.ImmutableBean, Serializable
Represents an amount associated with one leg of a swap.The amount is supplemented with details which would typically identify the swap leg. These are useful in order to interpret the amount without reference to the full product.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSwapLegAmount.BuilderThe bean-builder forSwapLegAmount.static classSwapLegAmount.MetaThe meta-bean forSwapLegAmount.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SwapLegAmount.Builderbuilder()Returns a builder used to create an instance of the bean.SwapLegAmountconvertedTo(Currency resultCurrency, FxRateProvider rateProvider)Converts this instance to an equivalent amount in the specified currency.booleanequals(Object obj)CurrencyAmountgetAmount()Gets the amount associated with the leg.CurrencygetCurrency()Gets the currency of the leg.PayReceivegetPayReceive()Gets whether the leg is pay or receive.SwapLegTypegetType()Gets the type of the leg, such as Fixed or Ibor.inthashCode()static SwapLegAmount.Metameta()The meta-bean forSwapLegAmount.SwapLegAmount.MetametaBean()static SwapLegAmountof(ResolvedSwapLeg leg, CurrencyAmount amount)Obtains an instance from a swap leg and amount.SwapLegAmount.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()
-
-
-
Method Detail
-
of
public static SwapLegAmount of(ResolvedSwapLeg leg, CurrencyAmount amount)
Obtains an instance from a swap leg and amount.- Parameters:
leg- the swap legamount- the amount- Returns:
- the swap leg amount
-
convertedTo
public SwapLegAmount convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
Description copied from interface:FxConvertibleConverts this instance to an equivalent amount in the specified currency.The result, which may be of a different type, will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.
- Specified by:
convertedToin interfaceFxConvertible<LegAmount>- Parameters:
resultCurrency- the currency of the resultrateProvider- the provider of FX rates- Returns:
- the converted instance, which should be expressed in the specified currency
-
meta
public static SwapLegAmount.Meta meta()
The meta-bean forSwapLegAmount.- Returns:
- the meta-bean, not null
-
builder
public static SwapLegAmount.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public SwapLegAmount.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getAmount
public CurrencyAmount getAmount()
Gets the amount associated with the leg. The meaning associated with this amount is implied by the context. This amount may have been currency converted.
-
getPayReceive
public PayReceive getPayReceive()
Gets whether the leg is pay or receive.- Returns:
- the value of the property, not null
-
getType
public SwapLegType getType()
Gets the type of the leg, such as Fixed or Ibor.- Returns:
- the value of the property, not null
-
getCurrency
public Currency getCurrency()
Gets the currency of the leg. This is not be affected by any currency conversion applied to the amount.- Returns:
- the value of the property, not null
-
toBuilder
public SwapLegAmount.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-