Class ConvertingRateCard

java.lang.Object
com.eqixiac.equinix.design.cost.ConvertingRateCard
All Implemented Interfaces:
RateCard

public final class ConvertingRateCard extends Object implements RateCard
A RateCard that answers every lookup in one target currency: a figure quoted in another currency is converted through a CurrencyConverter and its note says from what, at which rate, from which source and as of when. A figure whose currency no source covers is unpriced with that reason. The TCO and savings models wrap their card in one so they compare in the same currency, with the same rates, as the optimiser's RateCardCostModel. A figure converted at a bundled reference rate is tagged PriceSource.ESTIMATE.
  • Method Details

    • of

      public static ConvertingRateCard of(RateCard card, String target, CurrencyConverters.Chain converter)
      Parameters:
      card - the card to wrap
      target - the ISO 4217 code every answer is given in
      converter - the converter
      Returns:
      the converting card
    • target

      public String target()
      Returns:
      the target currency
    • converter

      public CurrencyConverters.Chain converter()
      Returns:
      the converter (for its fallback notes)
    • toTarget

      public PriceLookup<PriceQuote> toTarget(PriceLookup<PriceQuote> lookup)
      Converts a quote to the target currency.
      Parameters:
      lookup - a lookup in any currency
      Returns:
      the lookup in the target currency, or unpriced when no source has the rate
    • amount

      public Optional<BigDecimal> amount(BigDecimal amount, String currency)
      Converts an amount to the target currency.
      Parameters:
      amount - the amount
      currency - its ISO 4217 code
      Returns:
      the converted amount, or empty when no source has the rate
    • connection

      public Optional<PriceQuote> connection(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term)
      Description copied from interface: RateCard
      Resolves the price of a single Fabric connection / virtual connection.

      Implementation contract. The matching strategy is implementation-specific, and a card whose data lacks an axis (metro, term, type) still returns its best figure - or empty - rather than failing; callers must not assume every card is sensitive to every parameter. Of the bundled cards: CustomRateCard resolves the most specific declared entry (exact metro+term down to metro/term-agnostic, then a declared default); EquinixRateCard matches bandwidth and type against the live catalogue, honours a requested metro strictly (a wrong-metro row is never returned), and prefers a term-matched row - a different-term row is only ever returned with a note naming the substitution; ReferenceRateCard matches on bandwidth alone (smallest tabulated tier at or above the request, linearly extrapolated with an EXTRAPOLATED note above the top tier) and ignores type, metro, and term entirely.

      Specified by:
      connection in interface RateCard
      Parameters:
      type - the connection type (e.g. EVPL_VC); may be null for any type
      bandwidthMbps - the provisioned bandwidth in Mbps
      metro - the metro the connection originates in (may be null if metro-agnostic)
      term - the commitment term (may be null if term-agnostic)
      Returns:
      the resolved quote, or Optional.empty() if this card cannot price the connection
    • connectionLookup

      public PriceLookup<PriceQuote> connectionLookup(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term)
      Description copied from interface: RateCard
      RateCard.connection(ConnectionType, int, MetroCode, Term) with the reason when it cannot be priced. Cards override this to say exactly why (no metro, no live row, no declared rate); the default states that this card holds no figure.
      Specified by:
      connectionLookup in interface RateCard
      Parameters:
      type - the connection type; may be null
      bandwidthMbps - the bandwidth in Mbps
      metro - the metro; may be null
      term - the term; may be null
      Returns:
      the figure, or the reason there is none
    • cloudRouter

      public Optional<PriceQuote> cloudRouter(String packageCode, MetroCode metro, Term term)
      Description copied from interface: RateCard
      Resolves the price of a single Fabric Cloud Router instance.

      Implementation contract. As with RateCard.connection(ConnectionType, int, MetroCode, Term), matching is implementation-specific and cards without a metro/term axis return their best figure regardless. Of the bundled cards: CustomRateCard resolves the most specific declared (packageCode, metro, term) entry; EquinixRateCard matches the package code and metro structurally against the row's own descriptor (exact package equality, the row's own metro code) and prefers a term-matched row, labelling any term substitution; ReferenceRateCard ignores metro and term, and substitutes its STANDARD figure for an unlisted package with a note naming the substitution.

      Specified by:
      cloudRouter in interface RateCard
      Parameters:
      packageCode - the router package / tier code (e.g. "STANDARD"); may be null for any
      metro - the metro the router is deployed in (may be null if metro-agnostic)
      term - the commitment term (may be null if term-agnostic)
      Returns:
      the resolved quote, or Optional.empty() if this card cannot price the router
    • cloudRouterLookup

      public PriceLookup<PriceQuote> cloudRouterLookup(String packageCode, MetroCode metro, Term term)
      Description copied from interface: RateCard
      RateCard.cloudRouter(String, MetroCode, Term) with the reason when it cannot be priced.
      Specified by:
      cloudRouterLookup in interface RateCard
      Parameters:
      packageCode - the router package; may be null
      metro - the metro; may be null
      term - the term; may be null
      Returns:
      the figure, or the reason there is none
    • egress

      public Optional<EgressRate> egress(CloudProviderType provider, String region, EgressPath path, Term term)
      Description copied from interface: RateCard
      Resolves the per-GB data-egress rate for a cloud provider over a given path.

      Equinix does not sell cloud egress, so EquinixRateCard returns Optional.empty() here (the default); egress rates come from a CustomRateCard (your figures), a ReferenceRateCard (bundled indicative figures), or a provider-pricing-API card. The default returns empty so cards that do not model egress need not override it. Cards whose data has no region or term axis ignore those parameters - the custom and reference cards match on provider + path alone; only the provider-API adapters are region-sensitive.

      Specified by:
      egress in interface RateCard
      Parameters:
      provider - the cloud provider the data is leaving
      region - the provider region (may be null for a provider-wide rate)
      path - internet vs. private interconnect
      term - the commitment term (may be null; ignored by term-agnostic cards)
      Returns:
      the resolved egress rate, or Optional.empty() if this card cannot price it
    • egressLookup

      public PriceLookup<EgressRate> egressLookup(CloudProviderType provider, String region, EgressPath path, Term term)
      Description copied from interface: RateCard
      RateCard.egress(CloudProviderType, String, EgressPath, Term) with the reason when it cannot be priced.
      Specified by:
      egressLookup in interface RateCard
      Parameters:
      provider - the provider; may be null
      region - the region; may be null
      path - the path; may be null
      term - the term; may be null
      Returns:
      the rate, or the reason there is none
    • colocation

      public Optional<PriceQuote> colocation(ColocationItem item, MetroCode metro, Term term)
      Description copied from interface: RateCard
      Resolves the price of an Equinix colocation primitive - a cabinet, a kW of power, or a cross-connect (see ColocationItem for the per-unit semantics). This lets the cost models incorporate the physical-infrastructure side of a colocation-vs-cloud comparison with the caller's real figures, not just the interconnection. Cards that do not model colocation return Optional.empty() (the default); CustomRateCard prices whatever the caller declares.
      Specified by:
      colocation in interface RateCard
      Parameters:
      item - the colocation primitive to price
      metro - the metro (may be null if metro-agnostic)
      term - the commitment term
      Returns:
      the resolved per-unit monthly quote, or Optional.empty() if not priced
    • colocationLookup

      public PriceLookup<PriceQuote> colocationLookup(ColocationItem item, MetroCode metro, Term term)
      Description copied from interface: RateCard
      RateCard.colocation(ColocationItem, MetroCode, Term) with the reason when it cannot be priced.
      Specified by:
      colocationLookup in interface RateCard
      Parameters:
      item - the colocation primitive
      metro - the metro; may be null
      term - the term; may be null
      Returns:
      the figure, or the reason there is none
    • multicloudLink

      public Optional<MulticloudLinkQuote> multicloudLink(MulticloudLinkRequest request)
      Description copied from interface: RateCard
      Resolves the two-sided price of a native provider-to-provider multicloud link (for example AWS Interconnect - multicloud paired with a Google Partner Cross-Cloud Interconnect transport). No Equinix resource is part of such a link. Each provider bills its own side, so the result is a MulticloudLinkQuote with one PriceQuote per side rather than a single figure.

      Beta: the products this models reached general availability in 2026 and their public price lists are incomplete.

      Implementation contract. The default returns Optional.empty(), so a card that does not model native links needs no change. An empty result means the card has no data for the provider pair. A present result may still have one or both sides unpriced: a side is priced only from a figure the card holds, and is otherwise left empty with a reason; callers must check MulticloudLinkQuote.isFullyPriced() before treating the quote as a link price. Cards convert hourly rates to monthly at MulticloudLinkQuote.HOURS_PER_MONTH hours and state the conversion in the side's note. The per-GB charge on the link is a separate lookup: egress(provider, region, EgressPath.MULTICLOUD_INTERCONNECT, term).

      Of the bundled cards: ReferenceRateCard prices only the figures published on the providers' pricing pages (each note carries the source URL and retrieval date) and applies the AWS free tier only when the request opts in; CustomRateCard prices the sides the caller declared; a RateCard.layered(...) chain resolves each side independently, the earliest card that prices a side winning; EquinixRateCard and the provider-API adapters return empty.

      Specified by:
      multicloudLink in interface RateCard
      Parameters:
      request - the link to price: both providers and regions, bandwidth in Mbps, the AWS path tier (1-5), the term, and the AWS free-tier opt-in
      Returns:
      the two-sided quote, or Optional.empty() if this card has no data for the provider pair (or request is null)
    • source

      public PriceSource source()
      Description copied from interface: RateCard
      The dominant provenance of prices this card produces. Aggregating cards report PriceSource.COMPOSITE.
      Specified by:
      source in interface RateCard
      Returns:
      the price source
    • cardName

      public String cardName()
      Description copied from interface: RateCard
      A short name for this card in provenance trails and unpriced reasons; the simple class name by default.
      Specified by:
      cardName in interface RateCard
      Returns:
      the card's name