Class ImmutablePriceIndex

  • All Implemented Interfaces:
    FloatingRateIndex, Index, PriceIndex, Named, java.io.Serializable, Bean, ImmutableBean

    public final class ImmutablePriceIndex
    extends java.lang.Object
    implements PriceIndex, ImmutableBean, java.io.Serializable
    A price index implementation based on an immutable set of rules.

    A standard immutable implementation of PriceIndex.

    In most cases, applications should refer to indices by name, using PriceIndex.of(String). The named index will typically be resolved to an instance of this class. As such, it is recommended to use the PriceIndex interface in application code rather than directly referring to this class.

    See Also:
    Serialized Form
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns the name of the index.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of the index
      • meta

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

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

        public java.lang.String getName()
        Gets the index name, such as 'GB-HICP'.
        Specified by:
        getName in interface Index
        Specified by:
        getName in interface Named
        Specified by:
        getName in interface PriceIndex
        Returns:
        the value of the property, not null
      • getRegion

        public Country getRegion()
        Gets the region of the index.
        Specified by:
        getRegion in interface PriceIndex
        Returns:
        the value of the property, not null
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the index.
        Specified by:
        getCurrency in interface FloatingRateIndex
        Returns:
        the value of the property, not null
      • isActive

        public boolean isActive()
        Gets whether the index is active, defaulted to true.

        Over time some indices become inactive and are no longer produced. If this occurs, this flag will be set to false.

        Specified by:
        isActive in interface FloatingRateIndex
        Returns:
        the value of the property
      • getPublicationFrequency

        public Frequency getPublicationFrequency()
        Gets the publication frequency of the index. Most price indices are published monthly, but some are published quarterly.
        Specified by:
        getPublicationFrequency in interface PriceIndex
        Returns:
        the value of the property, not null
      • toBuilder

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