Record Class MetroPortfolio
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.spi.MetroPortfolio
- Record Components:
metros- the metros, sorted by code; never empty
-
Constructor Summary
ConstructorsConstructorDescriptionMetroPortfolio(List<MetroId> metros) Sorts, de-duplicates and rejects an empty or null-containing set. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()metros()Returns the value of themetrosrecord component.static MetroPortfolioof(Collection<MetroId> metros) static MetroPortfoliointsize()toString()Returns a string representation of this record class.
-
Constructor Details
-
MetroPortfolio
-
-
Method Details
-
of
- Parameters:
metros- the metros- Returns:
- a portfolio of them
-
ofCodes
- Parameters:
codes- metro codes, for example"DC", "LD"- Returns:
- a portfolio of them
-
size
public int size()- Returns:
- how many metros the portfolio has
-
contains
- Parameters:
metro- a metro- Returns:
- whether the portfolio includes it
-
key
- Returns:
- the codes joined with
+, for exampleDC+LD: a stable, readable key
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
metros
-