Class CustomRateCard.Builder
java.lang.Object
com.eqixiac.equinix.design.value.ratecard.CustomRateCard.Builder
- Enclosing class:
CustomRateCard
Fluent builder for a
CustomRateCard. All declared amounts share one
currency - default USD; whatever currency(String) value is in force at
build() time stamps every entry, regardless of declaration
order. Shorthand overloads without a metro/term declare "any metro, any term"
entries and overloads without a setup amount declare a zero NRC; at lookup time
the most specific declared entry wins (see the class javadoc), and re-declaring
an identical key replaces the earlier rate (last declaration wins).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the immutable rate card.cloudRouterRate(String packageCode, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly-only rate for a Cloud Router package.cloudRouterRate(String packageCode, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a Cloud Router package.cloudRouterRate(String packageCode, BigDecimal monthly) Declares a metro/term-agnostic monthly-only rate for a Cloud Router package (setup is zero).cloudRouterRate(String packageCode, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup rate for a Cloud Router package.colocationRate(ColocationItem item, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly rate for a colocation primitive.colocationRate(ColocationItem item, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a colocation primitive.colocationRate(ColocationItem item, BigDecimal monthly) Declares a metro/term-agnostic monthly rate for an Equinix colocation primitive (per the unit named onColocationItem- per cabinet, per kW, or per cross-connect).colocationRate(ColocationItem item, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup rate for an Equinix colocation primitive (per the unit named onColocationItem).connectionRate(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly-only rate for a connection.connectionRate(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a connection.connectionRate(ConnectionType type, int bandwidthMbps, BigDecimal monthly) Declares a metro/term-agnostic monthly-only connection rate (nulltype means "any connection type"; setup is zero).connectionRate(ConnectionType type, int bandwidthMbps, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup connection rate (nulltype means "any connection type").Sets the currency by ISO 4217 code, e.g.Sets the currency every declared amount is expressed in (default USD).defaultCloudRouterRate(BigDecimal monthly) Declares the fallback monthly Cloud Router rate (zero setup) returned when no declared router entry matches a lookup.defaultCloudRouterRate(BigDecimal monthly, BigDecimal setup) Declares the fallback monthly + one-time setup Cloud Router rate returned when no declared router entry matches a lookup.defaultConnectionRate(BigDecimal monthly) Declares the fallback monthly connection rate (zero setup) returned when no declared connection entry matches a lookup.defaultConnectionRate(BigDecimal monthly, BigDecimal setup) Declares the fallback monthly + one-time setup connection rate returned when no declared connection entry matches a lookup.egressRate(CloudProviderType provider, EgressPath path, BigDecimal perGb) Declares a per-GB data-egress rate for a cloud provider over a given path.multicloudLinkHourlyRate(CloudProviderType provider, int bandwidthMbps, Integer pathTier, BigDecimal hourly) Declares one provider's side of a native multicloud link as a flat hourly rate for a specific path tier (null= any tier).multicloudLinkHourlyRate(CloudProviderType provider, int bandwidthMbps, BigDecimal hourly) Declares one provider's side of a native multicloud link as a flat hourly rate, at any path tier.multicloudLinkRate(CloudProviderType provider, int bandwidthMbps, Integer pathTier, BigDecimal monthly, BigDecimal setup) Declares the monthly and one-time charge one provider bills for its side of a native multicloud link.multicloudLinkRate(CloudProviderType provider, int bandwidthMbps, BigDecimal monthly) Declares the monthly charge one provider bills for its side of a native multicloud link of the given size, at any path tier, with no one-time charge.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
currency
Sets the currency every declared amount is expressed in (default USD). It must be set before the first rate is declared: one card holds one currency, and changing it after rates exist would silently relabel them.- Parameters:
currency- the currency of all declared amounts- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- ifcurrencyis nullIllegalStateException- if a rate was already declared in another currency
-
currency
Sets the currency by ISO 4217 code, e.g."USD"or"EUR".- Parameters:
currencyCode- the ISO 4217 currency code- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the code is not a supported ISO 4217 codeIllegalStateException- if a rate was already declared in another currency
-
connectionRate
public CustomRateCard.Builder connectionRate(ConnectionType type, int bandwidthMbps, BigDecimal monthly) Declares a metro/term-agnostic monthly-only connection rate (nulltype means "any connection type"; setup is zero). -
connectionRate
public CustomRateCard.Builder connectionRate(ConnectionType type, int bandwidthMbps, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup connection rate (nulltype means "any connection type"). -
connectionRate
public CustomRateCard.Builder connectionRate(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly-only rate for a connection. Anullmetro or term means "any" for that axis, so this also expresses metro-only or term-only overrides. -
connectionRate
public CustomRateCard.Builder connectionRate(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a connection. Anullmetro or term means "any" for that axis. More specific entries win over less specific ones at lookup time (seeCustomRateCard). -
defaultConnectionRate
Declares the fallback monthly connection rate (zero setup) returned when no declared connection entry matches a lookup. Without a default, unmatched lookups return empty so a layered card can defer. -
defaultConnectionRate
Declares the fallback monthly + one-time setup connection rate returned when no declared connection entry matches a lookup. -
cloudRouterRate
Declares a metro/term-agnostic monthly-only rate for a Cloud Router package (setup is zero). -
cloudRouterRate
public CustomRateCard.Builder cloudRouterRate(String packageCode, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup rate for a Cloud Router package. -
cloudRouterRate
public CustomRateCard.Builder cloudRouterRate(String packageCode, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly-only rate for a Cloud Router package. Anullmetro or term means "any" for that axis. -
cloudRouterRate
public CustomRateCard.Builder cloudRouterRate(String packageCode, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a Cloud Router package. Anullmetro or term means "any" for that axis. More specific entries win over less specific ones at lookup time. -
defaultCloudRouterRate
Declares the fallback monthly Cloud Router rate (zero setup) returned when no declared router entry matches a lookup. -
defaultCloudRouterRate
Declares the fallback monthly + one-time setup Cloud Router rate returned when no declared router entry matches a lookup. -
egressRate
public CustomRateCard.Builder egressRate(CloudProviderType provider, EgressPath path, BigDecimal perGb) Declares a per-GB data-egress rate for a cloud provider over a given path. Provide bothEgressPath.INTERNETandEgressPath.PRIVATErates for a provider to drive the egress savings calculation. Egress entries have no region or term axis on this card - a declared rate answers everyegress(provider, region, path, term)lookup for its provider + path, whatever region and term are requested.- Parameters:
provider- the cloud provider the data leavespath- internet vs. private interconnectperGb- the price per decimal (SI) GB of egress- Returns:
- this builder for method chaining
-
colocationRate
Declares a metro/term-agnostic monthly rate for an Equinix colocation primitive (per the unit named onColocationItem- per cabinet, per kW, or per cross-connect). -
colocationRate
public CustomRateCard.Builder colocationRate(ColocationItem item, BigDecimal monthly, BigDecimal setup) Declares a metro/term-agnostic monthly + one-time setup rate for an Equinix colocation primitive (per the unit named onColocationItem). -
colocationRate
public CustomRateCard.Builder colocationRate(ColocationItem item, MetroCode metro, Term term, BigDecimal monthly) Declares a metro- and term-specific monthly rate for a colocation primitive. Anullmetro or term means "any" for that axis; more specific entries win. -
colocationRate
public CustomRateCard.Builder colocationRate(ColocationItem item, MetroCode metro, Term term, BigDecimal monthly, BigDecimal setup) Declares a metro- and term-specific monthly + one-time setup rate for a colocation primitive. Anullmetro or term means "any" for that axis. -
multicloudLinkRate
public CustomRateCard.Builder multicloudLinkRate(CloudProviderType provider, int bandwidthMbps, BigDecimal monthly) Declares the monthly charge one provider bills for its side of a native multicloud link of the given size, at any path tier, with no one-time charge. Beta.- Parameters:
provider- the provider billing this sidebandwidthMbps- the link size in Mbps; matched exactly at lookupmonthly- the monthly recurring charge in the card's currency- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the provider or amount is null, the bandwidth is not positive, or the amount is negative
-
multicloudLinkRate
public CustomRateCard.Builder multicloudLinkRate(CloudProviderType provider, int bandwidthMbps, Integer pathTier, BigDecimal monthly, BigDecimal setup) Declares the monthly and one-time charge one provider bills for its side of a native multicloud link. Beta.- Parameters:
provider- the provider billing this sidebandwidthMbps- the link size in Mbps; matched exactly at lookuppathTier- the AWS connectivity-scope tier (1-5) the rate applies to, ornullfor any tier; a tier-specific entry wins over the tier-agnostic onemonthly- the monthly recurring charge in the card's currencysetup- the one-time charge in the card's currency (null= zero)- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- if the provider or monthly amount is null, the bandwidth is not positive, the tier is outside 1-5, or an amount is negative
-
multicloudLinkHourlyRate
public CustomRateCard.Builder multicloudLinkHourlyRate(CloudProviderType provider, int bandwidthMbps, BigDecimal hourly) Declares one provider's side of a native multicloud link as a flat hourly rate, at any path tier. The card converts it to a monthly charge atMulticloudLinkQuote.HOURS_PER_MONTHhours per month and records the conversion in the quote's note. Beta.- Parameters:
provider- the provider billing this sidebandwidthMbps- the link size in Mbps; matched exactly at lookuphourly- the hourly rate in the card's currency- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- under the same conditions asmulticloudLinkRate(CloudProviderType, int, Integer, BigDecimal, BigDecimal)
-
multicloudLinkHourlyRate
public CustomRateCard.Builder multicloudLinkHourlyRate(CloudProviderType provider, int bandwidthMbps, Integer pathTier, BigDecimal hourly) Declares one provider's side of a native multicloud link as a flat hourly rate for a specific path tier (null= any tier). Converted to monthly atMulticloudLinkQuote.HOURS_PER_MONTHhours per month. Beta.- Parameters:
provider- the provider billing this sidebandwidthMbps- the link size in Mbps; matched exactly at lookuppathTier- the AWS connectivity-scope tier (1-5), ornullfor any tierhourly- the hourly rate in the card's currency- Returns:
- this builder for method chaining
- Throws:
IllegalArgumentException- under the same conditions asmulticloudLinkRate(CloudProviderType, int, Integer, BigDecimal, BigDecimal)
-
build
Builds the immutable rate card. Every declared entry is stamped with the builder's final currency and taggedPriceSource.CUSTOM.- Returns:
- the built rate card
-