Class ProviderSite

java.lang.Object
com.eqixiac.equinix.core.model.multicloud.ProviderSite

public class ProviderSite extends Object
One side of a specification environment: a provider and that provider's own name for a site (environment.yaml#/ProviderSites: providerId, site, displayName).

Beta: derived from the open specification at commit bbfc763 (see the package documentation).

Fields
FieldSpecification fieldConstraint
providerRefproviderIdrequired
sitesite required, not blank; surrounding whitespace is trimmed; case is preserved
displayNamedisplayName optional; null when the provider supplied none

A site name is provider-specific: a cloud region for a cloud provider (the specification's examples are us-east-1 and us-east4). The specification does not define what an Equinix site name would be; a metro code is an assumption, not a verified value.

Equality compares all three fields exactly. Use matches(ProviderRef, String) for a comparison that ignores displayName and the case of site.

Construct with of(ProviderRef, String) or the Lombok builder (ProviderSite.builder().providerRef(...).site(...).displayName(...).build()).

Author:
ianjones
  • Method Details

    • of

      public static ProviderSite of(ProviderRef providerRef, String site)
      Creates a site without a display name.
      Parameters:
      providerRef - the provider
      site - the provider-specific site name
      Returns:
      the provider site
      Throws:
      NullPointerException - if either argument is null
      IllegalArgumentException - if site is blank
    • matches

      public boolean matches(ProviderRef provider, String otherSite)
      Tests whether this is the given provider's given site. displayName is not compared. The site comparison trims otherSite and ignores case.
      Parameters:
      provider - the provider to compare; null never matches
      otherSite - the site name to compare; null never matches
      Returns:
      true when the provider is equal and the site names match