Class PriceQuote

java.lang.Object
com.eqixiac.equinix.design.value.ratecard.PriceQuote

public class PriceQuote extends Object
An immutable price for a single resource, split into its monthly-recurring (MRC) and non-recurring (one-time setup, NRC) components, tagged with the PriceSource it was resolved from.

All monetary values use BigDecimal to avoid floating-point drift, consistent with the rest of the SDK's billing models. Quotes are additive via plus(PriceQuote) so an engine can aggregate per-resource quotes into a deployment total while preserving provenance.

  • Constructor Details

    • PriceQuote

      public PriceQuote()
  • Method Details

    • of

      public static PriceQuote of(BigDecimal monthlyRecurring, BigDecimal nonRecurring, Currency currency, PriceSource source)
      Creates a quote with explicit MRC and NRC.
      Parameters:
      monthlyRecurring - the monthly recurring charge (defaults to zero if null)
      nonRecurring - the one-time setup charge (defaults to zero if null)
      currency - the currency of both amounts
      source - the provenance of this quote
      Returns:
      a new quote
    • monthly

      public static PriceQuote monthly(BigDecimal monthlyRecurring, Currency currency, PriceSource source)
      Creates a monthly-only quote (no one-time setup charge).
      Parameters:
      monthlyRecurring - the monthly recurring charge (defaults to zero if null)
      currency - the currency
      source - the provenance of this quote
      Returns:
      a new quote with a zero NRC
    • zero

      public static PriceQuote zero(Currency currency, PriceSource source)
      Creates a genuinely-free quote (zero MRC and NRC). This asserts a known price of zero - distinct from a rate card returning Optional.empty(), which means the item could not be priced at all.
      Parameters:
      currency - the currency
      source - the provenance of this quote
      Returns:
      a new zero-valued quote
    • withNote

      public PriceQuote withNote(String note)
      Returns a copy of this quote with the note replaced (this instance is immutable and unchanged).
      Parameters:
      note - the provenance note to attach (replaces any existing note)
      Returns:
      a new quote identical to this one but carrying the given note
    • annualizedTotal

      public BigDecimal annualizedTotal()
      The first-year total: MRC × 12 + NRC.
      Returns:
      the twelve-month cost including the one-time setup charge
    • totalOverTerm

      public BigDecimal totalOverTerm(Term term)
      The total cost over a commitment term: MRC × term.months() + NRC. This is the figure the TCO comparison ranks archetypes by, so one-time setup charges are never ignored in a recommendation.
      Parameters:
      term - the commitment term
      Returns:
      the full-term cost including the one-time setup charge
    • plus

      public PriceQuote plus(PriceQuote other)
      Sums this quote with another. Both must share the same currency - this class never fabricates an FX conversion. The resulting source is preserved when both quotes agree, otherwise it is reported as PriceSource.COMPOSITE. The per-quote notes are dropped on aggregation (a merged note would misattribute provenance); callers that need them must read the operands. A null argument returns this quote unchanged.
      Parameters:
      other - the quote to add (may be null)
      Returns:
      a new aggregated quote without a note
      Throws:
      IllegalArgumentException - if the currencies differ