Record Class LogisticsCalculator.TransportCost
java.lang.Object
java.lang.Record
net.chen.legacyLand.resource.LogisticsCalculator.TransportCost
- Enclosing class:
LogisticsCalculator
public static record LogisticsCalculator.TransportCost(double distance, double weight, double baseFee, double insuranceFee, double totalFee)
extends Record
运输成本详情
-
Constructor Summary
ConstructorsConstructorDescriptionTransportCost(double distance, double weight, double baseFee, double insuranceFee, double totalFee) Creates an instance of aTransportCostrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoublebaseFee()Returns the value of thebaseFeerecord component.doubledistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinsuranceFeerecord component.@NonNull StringtoString()Returns a string representation of this record class.doubletotalFee()Returns the value of thetotalFeerecord component.doubleweight()Returns the value of theweightrecord component.
-
Constructor Details
-
TransportCost
public TransportCost(double distance, double weight, double baseFee, double insuranceFee, double totalFee) Creates an instance of aTransportCostrecord class.- Parameters:
distance- the value for thedistancerecord componentweight- the value for theweightrecord componentbaseFee- the value for thebaseFeerecord componentinsuranceFee- the value for theinsuranceFeerecord componenttotalFee- the value for thetotalFeerecord component
-
-
Method Details
-
getDetailedInfo
-
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 with thecomparemethod from their corresponding wrapper classes. -
distance
public double distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord component
-
weight
public double weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
baseFee
public double baseFee()Returns the value of thebaseFeerecord component.- Returns:
- the value of the
baseFeerecord component
-
insuranceFee
public double insuranceFee()Returns the value of theinsuranceFeerecord component.- Returns:
- the value of the
insuranceFeerecord component
-
totalFee
public double totalFee()Returns the value of thetotalFeerecord component.- Returns:
- the value of the
totalFeerecord component
-