Record Class ClimateZone
java.lang.Object
java.lang.Record
org.episteme.social.geography.ClimateZone
- All Implemented Interfaces:
Serializable
public record ClimateZone(ClimateZone.Type type, Quantity<Temperature> averageTemp, Quantity<Length> annualRainfall)
extends Record
implements Serializable
Represents a simplified Köppen climate classification and associated metrics.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionClimateZone(ClimateZone.Type type, Real averageTemp, Real annualRainfall) Legacy constructor for simple values.ClimateZone(ClimateZone.Type type, Quantity<Temperature> averageTemp, Quantity<Length> annualRainfall) Creates an instance of aClimateZonerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannualRainfallrecord component.Returns the value of theaverageTemprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if the climate supports permanent human settlement.booleanChecks if the climate supports outdoor agriculture.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ClimateZone
Legacy constructor for simple values. -
ClimateZone
public ClimateZone(ClimateZone.Type type, Quantity<Temperature> averageTemp, Quantity<Length> annualRainfall) Creates an instance of aClimateZonerecord class.- Parameters:
type- the value for thetyperecord componentaverageTemp- the value for theaverageTemprecord componentannualRainfall- the value for theannualRainfallrecord component
-
-
Method Details
-
isHabitable
public boolean isHabitable()Checks if the climate supports permanent human settlement. -
supportsAgriculture
public boolean supportsAgriculture()Checks if the climate supports outdoor agriculture. -
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
averageTemp
Returns the value of theaverageTemprecord component.- Returns:
- the value of the
averageTemprecord component
-
annualRainfall
-