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 class
SwapLegAmount.Builder
The bean-builder forSwapLegAmount
.static class
SwapLegAmount.Meta
The meta-bean forSwapLegAmount
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SwapLegAmount.Builder
builder()
Returns a builder used to create an instance of the bean.SwapLegAmount
convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
Converts this instance to an equivalent amount in the specified currency.boolean
equals(Object obj)
CurrencyAmount
getAmount()
Gets the amount associated with the leg.Currency
getCurrency()
Gets the currency of the leg.PayReceive
getPayReceive()
Gets whether the leg is pay or receive.SwapLegType
getType()
Gets the type of the leg, such as Fixed or Ibor.int
hashCode()
static SwapLegAmount.Meta
meta()
The meta-bean forSwapLegAmount
.SwapLegAmount.Meta
metaBean()
static SwapLegAmount
of(ResolvedSwapLeg leg, CurrencyAmount amount)
Obtains an instance from a swap leg and amount.SwapLegAmount.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
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:FxConvertible
Converts 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:
convertedTo
in 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:
metaBean
in 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
-
-