Record Class RuleContext
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.RuleContext
- Record Components:
pricing- the pricing (possiblyEstatePricing.unavailable())thresholds- the thresholdsasOf- the reference time for ages
public record RuleContext(EstatePricing pricing, EstateThresholds thresholds, Instant asOf)
extends Record
What a rule may use besides the inventory and utilisation: pricing, thresholds, and the time the
analysis treats as "now" (the snapshot's as-of time, so offline re-runs give the same result).
-
Constructor Summary
ConstructorsConstructorDescriptionRuleContext(EstatePricing pricing, EstateThresholds thresholds, Instant asOf) Validates the fields. -
Method Summary
Modifier and TypeMethodDescriptionlongThe age of something created atcreatedAt, in whole days.asOf()Returns the value of theasOfrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.pricing()Returns the value of thepricingrecord component.Returns the value of thethresholdsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RuleContext
Validates the fields.
-
-
Method Details
-
ageDays
The age of something created atcreatedAt, in whole days.- Parameters:
createdAt- the creation time, ornull- Returns:
- the age in days, or
-1when unknown
-
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). -
pricing
-
thresholds
Returns the value of thethresholdsrecord component.- Returns:
- the value of the
thresholdsrecord component
-
asOf
-