Record Class TradeRouteMapper.RouteSegment
java.lang.Object
java.lang.Record
org.episteme.social.history.TradeRouteMapper.RouteSegment
- Record Components:
start- segment originend- segment destinationdistanceKm- distance in kilometerstravelDays- estimated travel time in daysdangerLevel- risk level (0.0 = safe, 1.0 = perilous)
- All Implemented Interfaces:
Serializable
- Enclosing class:
TradeRouteMapper
public static record TradeRouteMapper.RouteSegment(TradeRouteMapper.TradingPost start, TradeRouteMapper.TradingPost end, double distanceKm, int travelDays, double dangerLevel)
extends Record
implements Serializable
Specific segment between two consecutive trading posts in a route.
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRouteSegment(TradeRouteMapper.TradingPost start, TradeRouteMapper.TradingPost end, double distanceKm, int travelDays, double dangerLevel) Creates an instance of aRouteSegmentrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thedangerLevelrecord component.doubleReturns the value of thedistanceKmrecord component.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetravelDaysrecord component.
-
Constructor Details
-
RouteSegment
public RouteSegment(TradeRouteMapper.TradingPost start, TradeRouteMapper.TradingPost end, double distanceKm, int travelDays, double dangerLevel) Creates an instance of aRouteSegmentrecord class.- Parameters:
start- the value for thestartrecord componentend- the value for theendrecord componentdistanceKm- the value for thedistanceKmrecord componenttravelDays- the value for thetravelDaysrecord componentdangerLevel- the value for thedangerLevelrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
start
-
end
-
distanceKm
public double distanceKm()Returns the value of thedistanceKmrecord component.- Returns:
- the value of the
distanceKmrecord component
-
travelDays
public int travelDays()Returns the value of thetravelDaysrecord component.- Returns:
- the value of the
travelDaysrecord component
-
dangerLevel
public double dangerLevel()Returns the value of thedangerLevelrecord component.- Returns:
- the value of the
dangerLevelrecord component
-