Class MetroId
java.lang.Object
com.eqixiac.equinix.core.model.MetroId
A forward-compatible identifier for an Equinix metro: a normalized metro code string that can name
any metro, including ones added after this SDK was built and therefore absent from the
MetroCode enum. Use it where a metro must be referenced by code without being constrained
to the well-known set - e.g. keys in MetroRegistry, or provisioning against a brand-new
metro.
The code is normalized to upper case with surrounding whitespace trimmed. Two MetroIds
are equal when their normalized codes match. asMetroCode() bridges back to the enum when
the code is one of the well-known metros.
- Author:
- ianjones
-
Method Details
-
of
Creates aMetroIdfrom a metro code string (e.g."SV","da").- Parameters:
code- the metro code; normalized to upper case and trimmed- Returns:
- the metro id
- Throws:
NullPointerException- ifcodeis nullIllegalArgumentException- ifcodeis blank
-
of
Creates aMetroIdfrom a well-knownMetroCode.- Parameters:
metroCode- the metro code enum constant- Returns:
- the metro id
- Throws:
NullPointerException- ifmetroCodeis null
-
code
- Returns:
- the normalized metro code string (e.g.
"SV")
-
asMetroCode
-
isKnown
public boolean isKnown()- Returns:
trueif this code names a metro present in theMetroCodeenum
-
equals
-
hashCode
-
toString
-