Class FixedRateStubCalculation
- java.lang.Object
-
- com.opengamma.strata.product.swap.FixedRateStubCalculation
-
- All Implemented Interfaces:
Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class FixedRateStubCalculation extends Object implements org.joda.beans.ImmutableBean, Serializable
Defines the rate applicable in the initial or final stub of a fixed swap leg.A standard swap leg consists of a regular periodic schedule and one or two stub periods at each end. This class defines what fixed rate to use during a stub.
The calculation may be specified in two ways.
- A fixed rate, applicable for the whole stub
- A fixed amount for the whole stub
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFixedRateStubCalculation.MetaThe meta-bean forFixedRateStubCalculation.
-
Field Summary
Fields Modifier and Type Field Description static FixedRateStubCalculationNONEAn instance that has no special rate handling.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)OptionalDoublegetFixedRate()Gets the fixed rate to use in the stub.Optional<CurrencyAmount>getKnownAmount()Gets the known amount to pay/receive for the stub.inthashCode()booleanisFixedRate()Checks if the stub has a fixed rate.booleanisKnownAmount()Checks if the stub has a known amount.static FixedRateStubCalculation.Metameta()The meta-bean forFixedRateStubCalculation.FixedRateStubCalculation.MetametaBean()static FixedRateStubCalculationofFixedRate(double fixedRate)Obtains an instance with a single fixed rate.static FixedRateStubCalculationofKnownAmount(CurrencyAmount knownAmount)Obtains an instance with a known amount of interest.StringtoString()
-
-
-
Field Detail
-
NONE
public static final FixedRateStubCalculation NONE
An instance that has no special rate handling.
-
-
Method Detail
-
ofFixedRate
public static FixedRateStubCalculation ofFixedRate(double fixedRate)
Obtains an instance with a single fixed rate.- Parameters:
fixedRate- the fixed rate for the stub- Returns:
- the stub
-
ofKnownAmount
public static FixedRateStubCalculation ofKnownAmount(CurrencyAmount knownAmount)
Obtains an instance with a known amount of interest.- Parameters:
knownAmount- the known amount of interest- Returns:
- the stub
-
isFixedRate
public boolean isFixedRate()
Checks if the stub has a fixed rate.- Returns:
- true if a fixed rate applies
-
isKnownAmount
public boolean isKnownAmount()
Checks if the stub has a known amount.- Returns:
- true if the stub has a known amount
-
meta
public static FixedRateStubCalculation.Meta meta()
The meta-bean forFixedRateStubCalculation.- Returns:
- the meta-bean, not null
-
metaBean
public FixedRateStubCalculation.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getFixedRate
public OptionalDouble getFixedRate()
Gets the fixed rate to use in the stub. A 5% rate will be expressed as 0.05.If the fixed rate is present, then
knownAmountmust not be present.- Returns:
- the optional value of the property, not null
-
getKnownAmount
public Optional<CurrencyAmount> getKnownAmount()
Gets the known amount to pay/receive for the stub.If the known amount is present, then
fixedRatemust not be present.- Returns:
- the optional value of the property, not null
-
-