Class CustomRateCard.Builder

java.lang.Object
com.eqixiac.equinix.design.value.ratecard.CustomRateCard.Builder
Enclosing class:
CustomRateCard

public static final class CustomRateCard.Builder extends Object
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 Details

    • Builder

      public Builder()
  • Method Details

    • currency

      public CustomRateCard.Builder currency(Currency 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 - if currency is null
      IllegalStateException - if a rate was already declared in another currency
    • currency

      public CustomRateCard.Builder currency(String currencyCode)
      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 code
      IllegalStateException - 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 (null type 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 (null type 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. A null metro 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. A null metro or term means "any" for that axis. More specific entries win over less specific ones at lookup time (see CustomRateCard).
    • defaultConnectionRate

      public CustomRateCard.Builder defaultConnectionRate(BigDecimal monthly)
      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

      public CustomRateCard.Builder defaultConnectionRate(BigDecimal monthly, BigDecimal setup)
      Declares the fallback monthly + one-time setup connection rate returned when no declared connection entry matches a lookup.
    • cloudRouterRate

      public CustomRateCard.Builder cloudRouterRate(String packageCode, BigDecimal monthly)
      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. A null metro 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. A null metro or term means "any" for that axis. More specific entries win over less specific ones at lookup time.
    • defaultCloudRouterRate

      public CustomRateCard.Builder defaultCloudRouterRate(BigDecimal monthly)
      Declares the fallback monthly Cloud Router rate (zero setup) returned when no declared router entry matches a lookup.
    • defaultCloudRouterRate

      public CustomRateCard.Builder defaultCloudRouterRate(BigDecimal monthly, BigDecimal setup)
      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 both EgressPath.INTERNET and EgressPath.PRIVATE rates for a provider to drive the egress savings calculation. Egress entries have no region or term axis on this card - a declared rate answers every egress(provider, region, path, term) lookup for its provider + path, whatever region and term are requested.
      Parameters:
      provider - the cloud provider the data leaves
      path - internet vs. private interconnect
      perGb - the price per decimal (SI) GB of egress
      Returns:
      this builder for method chaining
    • colocationRate

      public CustomRateCard.Builder colocationRate(ColocationItem item, BigDecimal monthly)
      Declares a metro/term-agnostic monthly rate for an Equinix colocation primitive (per the unit named on ColocationItem - 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 on ColocationItem).
    • 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. A null metro 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. A null metro 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 side
      bandwidthMbps - the link size in Mbps; matched exactly at lookup
      monthly - 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 side
      bandwidthMbps - the link size in Mbps; matched exactly at lookup
      pathTier - the AWS connectivity-scope tier (1-5) the rate applies to, or null for any tier; a tier-specific entry wins over the tier-agnostic one
      monthly - the monthly recurring charge in the card's currency
      setup - 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 at MulticloudLinkQuote.HOURS_PER_MONTH hours per month and records the conversion in the quote's note. Beta.
      Parameters:
      provider - the provider billing this side
      bandwidthMbps - the link size in Mbps; matched exactly at lookup
      hourly - the hourly rate in the card's currency
      Returns:
      this builder for method chaining
      Throws:
      IllegalArgumentException - under the same conditions as multicloudLinkRate(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 at MulticloudLinkQuote.HOURS_PER_MONTH hours per month. Beta.
      Parameters:
      provider - the provider billing this side
      bandwidthMbps - the link size in Mbps; matched exactly at lookup
      pathTier - the AWS connectivity-scope tier (1-5), or null for any tier
      hourly - the hourly rate in the card's currency
      Returns:
      this builder for method chaining
      Throws:
      IllegalArgumentException - under the same conditions as multicloudLinkRate(CloudProviderType, int, Integer, BigDecimal, BigDecimal)
    • build

      public CustomRateCard build()
      Builds the immutable rate card. Every declared entry is stamped with the builder's final currency and tagged PriceSource.CUSTOM.
      Returns:
      the built rate card