com.opengamma.strata.basics.value

## Class ValueStep

• All Implemented Interfaces:
Serializable, Bean, ImmutableBean

public final class ValueStep
extends Object
implements ImmutableBean, Serializable
A single step in the variation of a value over time.

A financial value, such as the notional or interest rate, may vary over time. This class represents a single change in the value within ValueSchedule.

The date of the change is either specified explicitly, or in relative terms via an index. The adjustment to the value can also be specified absolutely, or in relative terms.

Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  ValueStep.Builder
The bean-builder for ValueStep.
static class  ValueStep.Meta
The meta-bean for ValueStep.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static ValueStep.Builder builder()
Returns a builder used to create an instance of the bean.
boolean equals(Object obj)
Optional<LocalDate> getDate()
Gets the date of the schedule period boundary at which the change occurs.
OptionalInt getPeriodIndex()
Gets the index of the schedule period boundary at which the change occurs.
ValueAdjustment getValue()
Gets the value representing the change that occurs.
int hashCode()
static ValueStep.Meta meta()
The meta-bean for ValueStep.
ValueStep.Meta metaBean()
static ValueStep of(int periodIndex, ValueAdjustment value)
Obtains an instance that applies at the specified schedule period index.
static ValueStep of(LocalDate date, ValueAdjustment value)
Obtains an instance that applies at the specified date.
ValueStep.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
String toString()
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface org.joda.beans.Bean

property, propertyNames
• ### Method Detail

• #### of

public static ValueStep of(int periodIndex,
ValueAdjustment value)
Obtains an instance that applies at the specified schedule period index.

This factory is used to define the date that the step occurs in relative terms. The date is identified by specifying the zero-based index of the schedule period boundary. The change will occur at the start of the specified period. Thus an index of zero is the start of the first period or initial stub. The index must be one or greater, as a change is not permitted at the start of the first period.

For example, consider a 5 year swap from 2012-02-01 to 2017-02-01 with 6 month frequency. A zero-based index of '2' would refer to start of the 3rd period, which would be 2013-02-01.

The value may be absolute or relative, as per ValueAdjustment.

Parameters:
periodIndex - the index of the period of the value change
value - the adjustment to make to the value
Returns:
the varying step
• #### of

public static ValueStep of(LocalDate date,
ValueAdjustment value)
Obtains an instance that applies at the specified date.

This factory obtains a step that causes the value to change at the specified date.

The value may be absolute or relative, as per ValueAdjustment.

Parameters:
date - the start date of the value change
value - the adjustment to make to the value
Returns:
the varying step
• #### meta

public static ValueStep.Meta meta()
The meta-bean for ValueStep.
Returns:
the meta-bean, not null
• #### builder

public static ValueStep.Builder builder()
Returns a builder used to create an instance of the bean.
Returns:
the builder, not null
• #### metaBean

public ValueStep.Meta metaBean()
Specified by:
metaBean in interface Bean
• #### getPeriodIndex

public OptionalInt getPeriodIndex()
Gets the index of the schedule period boundary at which the change occurs.

This property is used to define the date that the step occurs in relative terms. The date is identified by specifying the zero-based index of the schedule period boundary. The change will occur at the start of the specified period. Thus an index of zero is the start of the first period or initial stub. The index must be one or greater, as a change is not permitted at the start of the first period.

For example, consider a 5 year swap from 2012-02-01 to 2017-02-01 with 6 month frequency. A zero-based index of '2' would refer to start of the 3rd period, which would be 2013-02-01.

Returns:
the optional value of the property, not null
• #### getDate

public Optional<LocalDate> getDate()
Gets the date of the schedule period boundary at which the change occurs.

This property is used to define the date that the step occurs in absolute terms. This must be one of the unadjusted dates in the schedule period schedule. This is an unadjusted date and calculation period business day adjustments will apply.

For example, consider a 5 year swap from 2012-02-01 to 2017-02-01 with 6 month frequency. The date '2013-02-01' is an unadjusted schedule period boundary, and so may be specified here.

Returns:
the optional value of the property, not null
• #### getValue

public ValueAdjustment getValue()
Gets the value representing the change that occurs.

The adjustment can be an absolute value, or various kinds of relative values.

Returns:
the value of the property, not null
• #### toBuilder

public ValueStep.Builder toBuilder()
Returns a builder that allows this bean to be mutated.
Returns:
the mutable builder, not null
• #### equals

public boolean equals(Object obj)
Overrides:
equals in class Object
• #### hashCode

public int hashCode()
Overrides:
hashCode in class Object
• #### toString

public String toString()
Overrides:
toString in class Object

Copyright 2009-Present by OpenGamma Inc. and individual contributors