Class HolidayCalendarId

    • Method Detail

      • of

        public static HolidayCalendarId of​(String uniqueName)
        Obtains an instance from the specified unique name.

        The name uniquely identifies the calendar. The HolidayCalendar is resolved from ReferenceData when required.

        It is possible to combine two or more calendars using the '+' symbol. For example, 'GBLO+USNY' will combine the separate 'GBLO' and 'USNY' calendars. The resulting identifier will have the individual identifiers normalized into alphabetical order.

        uniqueName - the unique name
        the identifier
      • defaultByCurrency

        public static HolidayCalendarId defaultByCurrency​(Currency currency)
        Gets the default calendar for a currency.

        This uses data from HolidayCalendarDefaultData.ini to provide a default.

        currency - the currency to find the default for
        the holiday calendar
        IllegalArgumentException - if there is no default for the currency
      • getName

        public String getName()
        Gets the name that uniquely identifies this calendar.

        This name is used in serialization and can be parsed using of(String).

        Specified by:
        getName in interface Named
        the unique name
      • resolve

        public HolidayCalendar resolve​(ReferenceData refData)
        Resolves this identifier to a holiday calendar using the specified reference data.

        This returns an instance of HolidayCalendar that can perform calculations.

        Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.

        Specified by:
        resolve in interface Resolvable<HolidayCalendar>
        refData - the reference data, used to resolve the reference
        the resolved holiday calendar
        ReferenceDataNotFoundException - if the identifier is not found
      • queryValueOrNull

        public HolidayCalendar queryValueOrNull​(ReferenceData refData)
        Description copied from interface: ReferenceDataId
        Low-level method to query the reference data value associated with this identifier, returning null if not found.

        This is a low-level method that obtains the reference data value, returning null instead of an error. Applications should use ReferenceData.getValue(ReferenceDataId) in preference to this method.

        Specified by:
        queryValueOrNull in interface ReferenceDataId<HolidayCalendar>
        refData - the reference data to lookup the value in
        the reference data value, null if not found
      • combinedWith

        public HolidayCalendarId combinedWith​(HolidayCalendarId other)
        Combines this holiday calendar identifier with another.

        The resulting calendar will declare a day as a business day if it is a business day in both source calendars.

        other - the other holiday calendar identifier
        the combined holiday calendar identifier
      • equals

        public boolean equals​(Object obj)
        Checks if this identifier equals another identifier.

        The comparison checks the name.

        equals in class Object
        obj - the other identifier, null returns false
        true if equal
      • hashCode

        public int hashCode()
        Returns a suitable hash code for the identifier.
        hashCode in class Object
        the hash code
      • toString

        public String toString()
        Returns the name of the identifier.
        toString in class Object
        the name