Class PriceQuote
java.lang.Object
com.eqixiac.equinix.design.value.ratecard.PriceQuote
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe first-year total:MRC × 12 + NRC.static PriceQuotemonthly(BigDecimal monthlyRecurring, Currency currency, PriceSource source) Creates a monthly-only quote (no one-time setup charge).static PriceQuoteof(BigDecimal monthlyRecurring, BigDecimal nonRecurring, Currency currency, PriceSource source) Creates a quote with explicit MRC and NRC.plus(PriceQuote other) Sums this quote with another.totalOverTerm(Term term) The total cost over a commitment term:MRC × term.months() + NRC.Returns a copy of this quote with the note replaced (this instance is immutable and unchanged).static PriceQuotezero(Currency currency, PriceSource source) Creates a genuinely-free quote (zero MRC and NRC).
-
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 amountssource- 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 currencysource- the provenance of this quote- Returns:
- a new quote with a zero NRC
-
zero
Creates a genuinely-free quote (zero MRC and NRC). This asserts a known price of zero - distinct from a rate card returningOptional.empty(), which means the item could not be priced at all.- Parameters:
currency- the currencysource- the provenance of this quote- Returns:
- a new zero-valued quote
-
withNote
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
The first-year total:MRC × 12 + NRC.- Returns:
- the twelve-month cost including the one-time setup charge
-
totalOverTerm
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
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 asPriceSource.COMPOSITE. The per-quote notes are dropped on aggregation (a merged note would misattribute provenance); callers that need them must read the operands. Anullargument returns this quote unchanged.- Parameters:
other- the quote to add (may benull)- Returns:
- a new aggregated quote without a note
- Throws:
IllegalArgumentException- if the currencies differ
-