Class TcoCalculator.Builder
- Enclosing class:
TcoCalculator
compare().
Setters validate eagerly (fail-fast IllegalArgumentExceptions), so a
mistake surfaces at the call site rather than as a wrong number later.
Defaults: 1000 Mbps bandwidth, EVPL_VC connection type,
Term.MONTH_12, egress volume 0 GB, the three single-cloud archetypes
(once a peer cloud is set: PUBLIC_CLOUD_INTERNET, EQUINIX_INTERCONNECT and
NATIVE_MULTICLOUD_INTERCONNECT, without ON_PREM), no Cloud
Router, 1 cabinet, 1 cross-connect, 5.0 kW power draw, on-prem inputs from
the bundled reference midpoints, and the standard layered rate-card chain
(live Equinix pricing, then bundled reference figures). Cloud-to-cloud defaults:
no peer cloud, path tier 1, AWS free tier not applied, reverse volume equal to the
forward volume.
Constraints that span two levers are checked at compare(), because levers
may be set in any order: the native archetype, toRegion, pathTier,
reverseEgress and useAwsFreeTier(true) each require toCloud;
toCloud requires fromCloud and must differ from it;
useAwsFreeTier(true) requires AWS as one of the two clouds. Each violation is
an IllegalArgumentException naming the lever.
Currency contract for the onPrem* overrides: caller-supplied values are
taken to be in the comparison currency (the currency the egress rates
resolved to). The bundled midpoints are published in the reference data's own
currency (USD), so when the comparison currency is known to differ, an on-prem
archetype still relying on any midpoint is reported unpriced (with the
reason) rather than relabelled - supply all four overrides in the comparison
currency to price it.
-
Method Summary
Modifier and TypeMethodDescriptionadditionalLineItem(String label, BigDecimal monthly) Adds an arbitrary named monthly cost - e.g. compute, storage, or software the rate cards do not price - folded into every priced archetype's breakdown and total.archetypes(DeploymentArchetype... archetypes) Restricts the comparison to the given archetypes.bandwidthMbps(int bandwidthMbps) Sets the interconnect bandwidth in Mbps (default 1000).cabinets(int cabinets) Sets the number of colocation cabinets for the Equinix-interconnect archetype (default 1).compare()Runs the comparison.connectionType(ConnectionType connectionType) Sets the Fabric connection type priced for the Equinix archetype (defaultEVPL_VC).crossConnects(int crossConnects) Sets the number of Equinix cross-connects for the Equinix-interconnect archetype (default 1).Sets the currency every figure is compared in (default USD).currencyConverter(CurrencyConverter converter) Supplies a converter (for example a live FX feed) ranked below pinned rates and above the defaults.defaultRates(CurrencyConverter defaults) Replaces the default rate sources (live ECB rates, then the bundled table), for example withCurrencyConverters.bundledOnly()for an offline run.Sets the monthly cloud data-egress volume the comparison is built around (default 0).egressTerabytes(double terabytes) Shorthand foregress(terabytes, DataUnit.TERABYTE)(1 TB = 1000 GB).Pins exchange rates tocurrency(String); they take precedence over every other source.fromCloud(CloudProviderType provider) Sets the cloud provider the egress leaves - the provider whose internet and private egress rates are looked up.includeCloudRouter(String packageCode) Adds a Fabric Cloud Router of the given package to the Equinix archetype (none is included by default).Sets the provider region the egress originates in, in the provider's own region notation (e.g.Overrides the on-prem cross-connect monthly cost, in the comparison currency.onPremHardwareMonthly(BigDecimal value) Overrides the amortized on-prem hardware monthly cost, in the comparison currency.onPremPowerPerKwMonth(BigDecimal value) Overrides the on-prem power/space rate per kW per month, in the comparison currency.Overrides the on-prem carrier-transit rate per Mbps per month, in the comparison currency.pathTier(int pathTier) Sets the AWS connectivity-scope tier of the native link: 1 local (default), 2 regional, 3 continental, 4 long-haul, 5 maximum scope.powerKw(double powerKw) Sets the power draw in kW (default 5.0).Sets the rate card that prices every component of the comparison.reverseEgress(double amount, DataUnit unit) Sets the monthly volume flowing from the peer cloud back tofromCloud- the traffic the peer cloud bills as egress.Sets the commitment term (defaultTerm.MONTH_12).toCloud(CloudProviderType provider) Declares the peer cloud and makes the comparison cloud-to-cloud (see theTcoCalculatorclass documentation): the internet, Equinix and native archetypes are priced two-sided,NATIVE_MULTICLOUD_INTERCONNECTjoins the default archetype set andON_PREMleaves it (it carries no cloud egress and is reported unpriced when requested explicitly).Sets the peer cloud's region in its own notation (e.g.useAwsFreeTier(boolean useAwsFreeTier) Opts in to the AWS free tier for the native link: one free tier-1 500 Mbps interconnect per AWS Region per generally-available provider.Sets the Equinix metro the interconnect lands in, used for metro-sensitive rate lookups.
-
Method Details
-
egress
Sets the monthly cloud data-egress volume the comparison is built around (default 0).- Parameters:
amount- the volume inunits per monthunit- the unit the amount is expressed in (decimal/SI conversions)- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the amount is negative or not finite, or the unit is null
-
egressTerabytes
Shorthand foregress(terabytes, DataUnit.TERABYTE)(1 TB = 1000 GB). -
fromCloud
Sets the cloud provider the egress leaves - the provider whose internet and private egress rates are looked up.- Parameters:
provider- the cloud provider- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the provider is null, or equals atoCloud(...)already set
-
inRegion
Sets the provider region the egress originates in, in the provider's own region notation (e.g."us-east-1","westeurope"). Optional: region-agnostic rate cards ignore it, but the provider-API adapters need it.- Parameters:
region- the provider region identifier (may be null for provider-wide rates)- Returns:
- this builder for method chaining
-
toCloud
Declares the peer cloud and makes the comparison cloud-to-cloud (see theTcoCalculatorclass documentation): the internet, Equinix and native archetypes are priced two-sided,NATIVE_MULTICLOUD_INTERCONNECTjoins the default archetype set andON_PREMleaves it (it carries no cloud egress and is reported unpriced when requested explicitly). Beta.- Parameters:
provider- the cloud at the other end; must differ fromfromCloud(...)- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the provider is null, or equals afromCloud(...)already set (the same check runs again atcompare())
-
toRegion
Sets the peer cloud's region in its own notation (e.g."us-east4"). Optional. The bundled reference data uses it to select Google's transport location; with no region it prices a Google Cloud side at the North America location and says so in the figure's provenance.- Parameters:
region- the peer region identifier (may be null)- Returns:
- this builder for method chaining
-
pathTier
Sets the AWS connectivity-scope tier of the native link: 1 local (default), 2 regional, 3 continental, 4 long-haul, 5 maximum scope. AWS assigns the tier from the Region paths the interconnect serves and publishes no path-to-tier table, so it is an input, never derived. Providers without a tier concept ignore it.- Parameters:
pathTier- the tier, 1-5- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if outside 1-5
-
useAwsFreeTier
Opts in to the AWS free tier for the native link: one free tier-1 500 Mbps interconnect per AWS Region per generally-available provider. Off by default and never inferred, because the SDK cannot know whether the account already uses its free interconnect for the Region and provider. When set and the request is eligible (bandwidth at or below 500 Mbps, tier 1, eligible peer) the AWS side is priced at zero; when set but ineligible, the listed rate applies and the provenance says why.- Parameters:
useAwsFreeTier-trueto apply the free tier where eligible- Returns:
- this builder for method chaining
-
reverseEgress
Sets the monthly volume flowing from the peer cloud back tofromCloud- the traffic the peer cloud bills as egress. When not set, a cloud-to-cloud comparison assumes it equals the forward volume set withegress(double, DataUnit)and states that assumption inTcoComparison.getTrafficNote().- Parameters:
amount- the volume inunits per monthunit- the unit the amount is expressed in (decimal/SI conversions)- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the amount is negative or not finite, or the unit is null
-
viaMetro
Sets the Equinix metro the interconnect lands in, used for metro-sensitive rate lookups. Omit the call entirely for a metro-agnostic comparison.- Parameters:
metro- the Equinix metro- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the metro is null (omit the call instead)
-
bandwidthMbps
Sets the interconnect bandwidth in Mbps (default 1000). Drives the Fabric connection price, the CSP interconnect-port fee, and the on-prem carrier-transit line.- Parameters:
bandwidthMbps- the bandwidth in Mbps- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if not positive
-
connectionType
Sets the Fabric connection type priced for the Equinix archetype (defaultEVPL_VC).- Parameters:
connectionType- the connection type- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if null
-
includeCloudRouter
Adds a Fabric Cloud Router of the given package to the Equinix archetype (none is included by default). If the rate card cannot price the package, the archetype is reported as not fully priced with a note naming the missing router - its partial figures stay visible but it is excluded from the recommendation rather than silently under-priced.- Parameters:
packageCode- the router package code (e.g."STANDARD")- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the package code is null or blank
-
term
Sets the commitment term (defaultTerm.MONTH_12). It feeds the term-aware rate lookups and defines the horizon archetypes are ranked over (MRC × months + setup).- Parameters:
term- the commitment term- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if null
-
currency
Sets the currency every figure is compared in (default USD). Figures quoted in another currency are converted: rates pinned withexchangeRates, thencurrencyConverter, then live ECB reference rates (one call), then the SDK's bundled table. Only a currency no source covers is unpriced.- Parameters:
currency- ISO 4217 code- Returns:
- this builder for method chaining
-
exchangeRates
Pins exchange rates tocurrency(String); they take precedence over every other source.- Parameters:
rates- the rates, ornullfor none- Returns:
- this builder for method chaining
-
currencyConverter
Supplies a converter (for example a live FX feed) ranked below pinned rates and above the defaults.- Parameters:
converter- the converter, ornullfor none- Returns:
- this builder for method chaining
-
defaultRates
Replaces the default rate sources (live ECB rates, then the bundled table), for example withCurrencyConverters.bundledOnly()for an offline run.- Parameters:
defaults- the fallback converter, ornullfor the defaults- Returns:
- this builder for method chaining
-
rateCard
Sets the rate card that prices every component of the comparison. When omitted, the standard layered chain (RateCard.standardChain(fabric)) applies: live Equinix Fabric pricing first, then the bundledReferenceRateCard, which also supplies indicative cloud-egress rates. A supplied card replaces that chain entirely; layer it yourself (e.g.RateCard.layered(custom, RateCard.standardChain(fabric))) to keep the defaults as a fallback.- Parameters:
rateCard- the rate card to price with, ornullto use the standard chain- Returns:
- this builder for method chaining
-
archetypes
Restricts the comparison to the given archetypes. The default isPUBLIC_CLOUD_INTERNET,ON_PREMandEQUINIX_INTERCONNECT; when a peer cloud is set withtoCloud(...)it isPUBLIC_CLOUD_INTERNET,EQUINIX_INTERCONNECTandNATIVE_MULTICLOUD_INTERCONNECT. Requesting the native archetype without a peer cloud fails atcompare(). RequestingON_PREMwith a peer cloud is accepted; the breakdown is reported unpriced with the reason and is never recommended.- Parameters:
archetypes- the archetypes to compare- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the array is null, empty, or contains null
-
cabinets
Sets the number of colocation cabinets for the Equinix-interconnect archetype (default 1). The per-cabinetColocationItem.CABINETquote - when the rate card prices one - is multiplied by this count. -
crossConnects
Sets the number of Equinix cross-connects for the Equinix-interconnect archetype (default 1). The per-unitColocationItem.CROSS_CONNECTquote (or the reference cross-connect figure when no colocation rate is supplied) is multiplied by this count; zero omits cross-connects entirely. -
powerKw
Sets the power draw in kW (default 5.0). Note the dual use: it scales both the on-prem power/space line (per-kW midpoint × kW) and the Equinix archetype's colocation power line when the rate card pricesColocationItem.POWER_PER_KW- tuning it for one side changes the other.- Parameters:
powerKw- the power draw in kW- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if negative or not finite
-
onPremTransitPerMbpsMonth
Overrides the on-prem carrier-transit rate per Mbps per month, in the comparison currency. -
onPremHardwareMonthly
Overrides the amortized on-prem hardware monthly cost, in the comparison currency. -
onPremCrossConnectMonthly
Overrides the on-prem cross-connect monthly cost, in the comparison currency. -
onPremPowerPerKwMonth
Overrides the on-prem power/space rate per kW per month, in the comparison currency. -
additionalLineItem
Adds an arbitrary named monthly cost - e.g. compute, storage, or software the rate cards do not price - folded into every priced archetype's breakdown and total. Because it is applied uniformly, it makes the absolute TCO figures realistic without changing which archetype is cheapest (the savings comparison is unaffected). Call multiple times for multiple line items.- Parameters:
label- the line-item label shown in each breakdownmonthly- the monthly amount (in the comparison currency)- Returns:
- this builder for method chaining
-
compare
Runs the comparison.- Returns:
- the TCO comparison across the requested archetypes
- Throws:
IllegalArgumentException- if levers conflict: the native archetype,toRegion,pathTier,reverseEgressoruseAwsFreeTier(true)withouttoCloud;toCloudwithout, or equal to,fromCloud; oruseAwsFreeTier(true)when neither cloud is AWS
-